Showing posts with label drop. Show all posts
Showing posts with label drop. Show all posts

March 10, 2022

Git remove a specific commit(s) from history

 Hi all,

This blog post will let you know about the process of removing the git commit from git history.


Sample Git log

> git log 

38384b3 initial commit

f96751b UI changes

2154131 file added

bf9b9c1 Logic corrections

3e75ab7 Bug fix -> (HEAD)


Use case

Remove the commit "file added"


Procedure

  • Rebase in interaction mode one commit above which we want to remove.

> git rebase -i f96751b

  • All the commits up to the specified commit will be listed in an order with the prefix "pick". Along with commit messages, the useful commands are available like below.

pick = use commit

reword = use commit, but edit the commit message

edit = use commit, but stop for amending

squash = use commit, but meld into previous commit

fixup = like "squash", but discard this commit's log message

exec = run command (the rest of the line) using shell

drop = remove commit

  • Delete the unwanted commits from the file
    • Press 'd' twice to delete line (in case of vi editor)
  • Save and quit the editor
    • esc -> :wq (in case of vi editor)
  • If there are any merge conflicts, resolve it and perform rebase continue
    • > git rebase --continue
  • Once all the merges are completed, perform the push operation
    • > git push --force-with-lease origin
Hope this helps you make sure, you have clean git history.

Feel free to send your suggestions and comments to psrdotcom@gmail.com


June 10, 2020

Microsoft Azure SQL Server Read Only User Creation Deletion

Hi folks,

Today I will explain, how you can easily manage the readonly (view) users in Azure Microsoft SQL Server

Procedure

In Azure SQL Server

CREATE LOGIN [testuser] WITH PASSWORD = 'random_p@$$w0rd';

For master and each DB

Note: You must create the user in master db before creating in other databases
CREATE USER [testuser] FOR LOGIN [testuser]   
    WITH DEFAULT_SCHEMA = [dbo];  
GO

Grant Connect permission

GRANT CONNECT TO [testuser]
GO

Give datareader role to read (view) only

ALTER ROLE db_datareader ADD MEMBER [testuser]
GO

Drop user in DB

DROP USER [testuser]
GO

Drop user in Azure SQL

DROP LOGIN [testuser];
GO

Please send your comments and feedback to psrdotcom@gmail.com

November 26, 2018

Oracle Drop/Delete User with All tables and files

Hi All,

Today I am going to explain the procedure to delete/drop a user in Oracle database along with tables and mapped files for that user tablespace.

Pre-requisites

Oracle database with the following

  1. User
  2. Tablespace of the user
  3. Datafile of the tablespace

Procedure

Drop the user

Syntax: DROP USER CASCADE;
Example: DROP USER sampleuser CASCADE;

Make the tablespace offline

Syntax: ALTER TABLESPACE OFFLINE;
Example: ALTER TABLESPACE sampletablespace OFFLINE;

Drop the tablespace with mapped datafile[s]

Syntax: DROP TABLESPACE INCLUDING CONTENTS AND DATAFILES
Example: DROP TABLESPACE sampletablespace INCLUDING CONTENTS AND DATAFILES

With the above 3 commands, you can make sure that, user and user related data has been completed removed from database.

Hope, it will help to resolve your issue.

Please send your feedback and comments to psrdotcom@gmail.com

December 11, 2015

Windows 7 Unable to drag and drop with mouse issue resolution

Hi friends,

Today, when I was working suddenly I felt like my mouse is not performing drag and drop.

I found a simple solution
  1. Press and hold any file in file explorer with your primary (left mouse) button
  2. Click "Esc" (Escape) key on your keyboard
  3. You should be able to perform drag and drop of files now

Please send your feedback and comments to psrdotcom@gmail.com


Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com