Unstage tracked files
$ git reset HEAD [file]
Undo last commit (keeping changes)
$ git reset --soft HEAD^
Resolve conflicts
- Go to the branch you want to merge with (master, for instance)
$ git checkout master
- Pull changes from that branch
$ git pull
- Go to the branch with conflicts and rebase it with master
$ git checkout [branch] && git rebase master
- Resolve any conflict that shows up and add changes
$ git add .
- Continue rebasing your branch
$ git rebase --continue
- Repeat steps until you have no more files with conflicts and the rebase is finished.
Delete specified branch
$ git branch -d [branch-name]
Rename current branch
$ git branch -m [new-branch-name]
Check list of commits (oneline mode)
$ git log --oneline
Apply and remove changes stashed
$ git stash pop
Include changes on last commit
$ git commit --amend
Save git credentials
$ git config credential.helper store
Reset local branch with remote branch
git reset --hard origin/master
Update local branch with remote
git fetch && git rebase origin/master