Showing posts with label commit. Show all posts
Showing posts with label commit. 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


November 26, 2018

Oracle Create User with custom tablespace and datafile

Hi all,

Through I have explained the procedure to delete/drop the user with tablespace and datafiles. I though of giving information about creating a user with custom tablespace and datafile.

Pre-requisites


  1. Oracle database
  2. Login as sys as sysdba

Procedure

Create tablespace

Syntax: CREATE TABLESPACE DATAFILE SIZE ;
Example: CREATE TABLESPACE sample_tablespace DATAFILE 'C:\\samplets.dbf' SIZE 100M;
Example: CREATE TABLESPACE sample_tablespace DATAFILE '\usr\local\datafiles\samplets.dbf' SIZE 100M;

User creation

Alter session
ALTER SESSION SET "_ORACLE_SCRIPT"=true;

Create User
Syntax: CREATE USER IDENTIFIED BY DEFAULT TABLESPACE ;
Example: CREATE USER sampleuser IDENTIFIED BY samplepwd DEFAULT TABLESPACE sample_tablespace;

Grant privilieges
Syntax: GRANT ALL PRIVILEGES to ;
Example: GRANT ALL PRIVILEGES to sampleuser;

Commit the commands
commit;

Now, you should be able to create the tablespace and made that as default tablespace for the newly created user.

Hope, this information helps you.

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

Featured Post

Java Introdcution

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