Skip to content

Version Control

Kanit Wongsuphasawat edited this page Jun 27, 2016 · 9 revisions

Git & Github

FAQs & Tips

  • Atomic Commit is a good practice

  • Stash is useful when you have unfinished messy things and need to switch branches to work on something else.

  • Interactive Rebase is useful for making your commit logs cleaner.

  • Need to merge multiple repos (e.g. using datavore in another project)? Use git subtree and DO NOT use git submodule.

  • To make git push only push current branch by default, try git config --global push.default current

Three ways to merge a pull request

  • Github's merge squash = git rebase -i master and squash all commits + push result to master

  • Github merge = git checkout master && git merge <branch> —no-ff

  • If you want linear history without squashing, manually do git checkout master && git merge <branch> (without —no-ff) would make the result linear too.

Resources

Clone this wiki locally