Cheat Sheet
Useful git commands
Branch
Move changes to another branch
git stash
# To create a new branch
git checkout -b correct-branch
# To use an existing branch...
# git checkout correct-branch
git stash popDiscard local changes
git reset --hard origin/master
git pull origin masterUpdate parent branch
git checkout feature_abc
git checkout -b feature_def
# --> Someone changed something in feature_abc
git pull origin feature_abcClone
Git clone private repo
Where:
myemail%40gmail.commeans[email protected]and it is your username;123456is your password;
Fork
Keeping a fork up to date
Clone your fork
Add remote from original repository in your forked repository.
Updating your fork from original repo to keep up with their changes.
Track forks
https://techgaun.github.io/active-forks/index.html
Manage credentials
Store credentials permanently
Store credentials on cache
To avoid providing the same credentials every time, you may enable the Git credentials cache through the following command:
The default cache expiry timeout is 900 seconds (15 minutes) and can be changed with the --timeoutoption as follows:
If you want the daemon to exit early, forgetting all cached credentials before their timeout, you can issue an exit action:
Module
Remove submodule
References
https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule
Push
You cannot push commits for '[email protected]'. You can only push commits that were committed with one of your own verified emails.
Tag
Create
Delete
Last updated