Skip to content

Instantly share code, notes, and snippets.

@drmalex07
Created March 14, 2014 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drmalex07/9546789 to your computer and use it in GitHub Desktop.
Save drmalex07/9546789 to your computer and use it in GitHub Desktop.
Provide a simple workflow for a git rebase scenario. #git #git-rebase #scm
# Create a branch named "feature-a"
git branch feature-a
# Switch to branch "feature-a" updating your working copy
git checkout feature-a
# Work ...
vim hello.py
vim README
# Meanwhile new changes have been applied to master
# rebase our branch to master
git rebase master
# Switch to "master" beanch
git checkout master
git merge feature-a
# View diffs
git difftool --tool=meld
# Resolve conflicts, if any
git mergetool --tool=meld
# Push branch (same name) to a remote repo
git push -u origin feature-a
# Delete branch
git branch -D feature-a
# Delete remote branch
git push origin --delete feature-a
[user]
email = foo@example.com
name = foo
[merge]
tool = meld
[alias]
logg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
logg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
logg = !"git logg1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment