Last active
April 3, 2018 15:06
-
-
Save h3nr1ke/054a5345590755eae677831f78dc91a8 to your computer and use it in GitHub Desktop.
Useful git tips
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--- good resource | |
http://gitready.com/ | |
#--- When you want to commit files that used to be ignored or vice versa | |
git rm -r --cached . | |
git add . | |
git commit -m "Commit follows the .gitignore again" | |
#--- Get the remote URL from a repository | |
git config --get remote.origin.url | |
#--- Save password | |
git config credential.helper store | |
#--- Create a tag | |
git tag -a v0.1 -m 'Version 0.1 of my software' | |
#--- Remove a tag | |
git tag -d <TAG_NAME> | |
git push origin :refs/tags/<TAG_NAME> | |
#--- Read local and remote branchs | |
git branch -a #local and remote | |
git branch -r #only remotes | |
#--- Push local branch | |
git push -u origin <branchname> | |
#--- change user name and email | |
git config --global user.name "Your Name" | |
git config --global user.email "[email protected]" | |
#--- get all commits from a specific file | |
git log --follow filename | |
#--- remove a local branch | |
git branch -d branch_name | |
#-- list all branchs | |
git branch -a | |
#-- list only remote brnachs | |
git branch -r | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment