Skip to content

Instantly share code, notes, and snippets.

@milingo
Last active January 29, 2016 09:56
Show Gist options
  • Save milingo/9061842 to your computer and use it in GitHub Desktop.
Save milingo/9061842 to your computer and use it in GitHub Desktop.
Git

Tutorial

###Remove a merged branch git branch -d BRANCH

git push origin --delete BRANCH

Merge develop with feature branch

git checkout develop

git pull

git checkout BRANCH

git rebase develop

-- solve possible conflicts

git rebase --continue

git push --force

Log

git log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short

Aliases in .profile

alias gs='git status ' alias ga='git add ' alias gb='git branch ' alias gc='git commit' alias gd='git diff' alias go='git checkout ' alias gk='gitk --all&' alias gx='gitx --all'

alias got='git ' alias get='git '

Aliases in .gitconfig

[alias] co = checkout ci = commit st = status br = branch hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short type = cat-file -t dump = cat-file -p

Sync forked repo

git fetch upstream git checkout master git merge upstream/master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment