mirror of
https://github.com/cheat/cheat.git
synced 2024-12-23 21:19:44 +01:00
34 lines
1.3 KiB
Plaintext
34 lines
1.3 KiB
Plaintext
# To set your identify:
|
|
git config --global user.name "John Doe"
|
|
git config --global user.email johndoe@example.com
|
|
|
|
# To set your editor:
|
|
git config --global core.editor emacs
|
|
|
|
# To enable color:
|
|
git config --global color.ui true
|
|
|
|
# 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
|
|
|
|
# To sync a fork with the master repo:
|
|
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
|
|
git checkout master # Checkout local master branch
|
|
git checkout -b branch # Create and checkout a new branch
|
|
git merge upstream/master # Merge remote into local repo
|
|
git show 83fb499 # Show what a commit did.
|
|
git log # Show all the commits
|
|
git status # Show the changes from last commit
|