cheat/cheatsheets/git

28 lines
959 B
Text
Raw Normal View History

# To set your identify:
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
# To enable color:
git config --global color.ui true
2013-08-27 02:34:36 +02:00
# To stage all changes for commit:
git add --all
# To commit staged changes
git commit -m "Your commit message"
# To push to the tracked master branch:
git push origin master
# To push to a specified repository:
git push git@github.com:username/project.git
2013-08-27 10:56:53 +02:00
# To sync a fork with the master repo:
2013-08-28 01:43:24 +02:00
git remote add upstream git@github.com:name/repo.git # Set a new repo
git remote -v # Confirm new remote repo
git fetch upstream # Get branches
git branch -va # List local - remote branches
2013-08-28 09:30:37 +02:00
git checkout master # Checkout local master branch
2013-08-28 01:43:24 +02:00
git merge upstream/master # Merge remote into local repo
2013-08-27 10:56:53 +02:00