Skip to content

Instantly share code, notes, and snippets.

@kapilghimire
Last active June 10, 2019 04:09
Show Gist options
  • Save kapilghimire/575f7885817770fd823a28e891a40a4a to your computer and use it in GitHub Desktop.
Save kapilghimire/575f7885817770fd823a28e891a40a4a to your computer and use it in GitHub Desktop.
Git command
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
// 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
// no fast forward merge
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment