Skip to content

Instantly share code, notes, and snippets.

View Tranca-Dev's full-sized avatar

Francisco Cittadini Tranca-Dev

  • Buenos Aires, Argentina
View GitHub Profile
@bcherny
bcherny / gist:de24955c15430efd99f1
Last active April 30, 2021 12:09
How to squash commits with git

Let's say you have a Pull Request from myBranch to master with 3 commits, and you want them to appear as a single commit in master.

If you're merging on the command line, this is trivial:

git checkout master
git merge --squash myBranch
git commit
@robmiller
robmiller / .gitconfig
Created July 17, 2013 07:52
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"