git init
git config --global init.defaultBranch <name>
eg:
git config --global init.defaultBranch master
git clone <repo_url>
or
git remote add origin <repo_url>
git config --get remote.origin.url
or
git remote -v
git remote set-url <remote_name> <new_path>
git fetch origin
git log HEAD..origin/master --oneline
If any commits are listed in the output above, then you have incoming changes -- you need to merge. If no commits are listed by git log then there is nothing to merge.
Note that this will work even if you are on a feature branch -- that does not have a tracking remote, since it explicitly refers to origin/master instead of implicitly using the upstream branch remembered by Git.
git config core.longpaths true
git checkout master
git pull origin master
git merge test
git push origin master
gitk <filename>
git checkout tags/<tag_name> -b <branch_name>
git reset --soft HEAD~1
- keep changes
git reset --hard HEAD~1
- remove changes
git reset --hard origin/master
- if all fails
If you want to temporarily go back to it, fool around, then come back to where you are, all you have to do is check out the desired commit:
git checkout 0d1d7fc32