Skip to content

Instantly share code, notes, and snippets.

@yannickcr
Last active May 24, 2016 15:35
Show Gist options
  • Save yannickcr/1db3517152de5d9b2199 to your computer and use it in GitHub Desktop.
Save yannickcr/1db3517152de5d9b2199 to your computer and use it in GitHub Desktop.
Git Alias for Gerrit
[alias]
patch = commit --amend --no-edit --reset-author
yolo = commit --amend --no-edit --reset-author --no-verify
update = pull --ff-only
draft = !sh -c 'git push origin HEAD:refs/drafts/master/${1-bugfix}' -
publish = !sh -c 'git push origin HEAD:refs/for/master/${1-bugfix}' -
git checkout master         // Switch to master
git update                  // Update master
git checkout -b NEW-FEATURE // Start a new feature
[...]                       // Working
git commit                  // Commit changes
git draft feature           // Publish changes as draft with the label "feature" (default: bugfix)
[...]                       // Working
git patch                   // Amend changes to last commit
git publish feature         // Publish changes with the label "feature" (default: bugfix)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment