Skip to content

Instantly share code, notes, and snippets.

@kapilghimire
Last active June 10, 2019 04:09
Show Gist options
  • Select an option

  • Save kapilghimire/575f7885817770fd823a28e891a40a4a to your computer and use it in GitHub Desktop.

Select an option

Save kapilghimire/575f7885817770fd823a28e891a40a4a to your computer and use it in GitHub Desktop.

Revisions

  1. kapilghimire revised this gist Jun 10, 2019. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions Git comand
    Original file line number Diff line number Diff line change
    @@ -25,3 +25,6 @@ git merge --no-ff <<branch name>>
    // using diff tool
    git difftool <<filename>>

    // to copy last commit version of file to working directore
    git checkout filename

  2. kapilghimire revised this gist Jun 4, 2019. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion Git comand
    Original file line number Diff line number Diff line change
    @@ -20,4 +20,8 @@ $ (some_branch) git commit --amend --no-edit


    // no fast forward merge
    git merge --no-ff <<branch name>>
    git merge --no-ff <<branch name>>

    // using diff tool
    git difftool <<filename>>

  3. kapilghimire revised this gist Jun 3, 2019. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion Git comand
    Original file line number Diff line number Diff line change
    @@ -16,4 +16,8 @@ git log --oneline
    $ (some_branch) git commit --amend

    // adding files to last commit no modifying last commit message
    $ (some_branch) git commit --amend --no-edit
    $ (some_branch) git commit --amend --no-edit


    // no fast forward merge
    git merge --no-ff <<branch name>>
  4. kapilghimire revised this gist May 31, 2019. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion Git comand
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,10 @@ git reset --hard HEAD
    // rebase
    git rebase -i HEAD~3

    git log --oneline
    git log --oneline

    // adding files to last commit modifying last commit message
    $ (some_branch) git commit --amend

    // adding files to last commit no modifying last commit message
    $ (some_branch) git commit --amend --no-edit
  5. kapilghimire revised this gist May 28, 2019. 1 changed file with 13 additions and 1 deletion.
    14 changes: 13 additions & 1 deletion Git comand
    Original file line number Diff line number Diff line change
    @@ -1 +1,13 @@
    git clean -fd
    git clean -fd


    // to add notepadd++ as default editor
    git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"

    // to reset your working directory to latest commit --- be sure what you are doing
    git reset --hard HEAD

    // rebase
    git rebase -i HEAD~3

    git log --oneline
  6. kapilghimire created this gist May 19, 2019.
    1 change: 1 addition & 0 deletions Git comand
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    git clean -fd