- Git Help
- Clone Repo
- Fix filename too long error
- Pushing to online repo
- Delete remote branch
- Merge branchB into branchA
- Rename Branch
- Create SubBranch
- List Branches
- See log of remote branch
- Undo Commits, Reapply Later
- Remove all Uncommitted Changes
- See List of Tracked Files
- Tag a commit
- Create a remote origin
git checkout -b my-new-branch
git clone ssh://<repo_url>
You'll probably have to run your shell as an administrator if in Windows
git config --system core.longpaths true
git checkout master
git pull
git checkout <your branch>
# just to make sure everything is committed
git commit -am "<commit message>"
# rebase to combine possible changes from others to master
git rebase master
git push origin <your branch>
After that, if you want to push to the remote master, do this (only after completing the previous step!):
git checkout master
git merge devBranchName
git push
git push origin --delete branch_name
git checkout branchA
git merge branchB
branchB can now be safely removed.
git branch -d <branch path>
Current Branch:
git branch -m newName
Other Branch:
git branch -m oldName newName
git branch subBranchName parentBranchName
# local branches
git branch
# remote branches
git branch -r
git log origin/master
# go back a commit
git reset --soft HEAD^
git stash save "name to be saved in stash"
# repeat as needed
# do whatever you need to do here
# reapply commits
git stash pop
git commit -am "title of commit to be reapplied"
# repeat as needed
While in the master repository root:
git checkout -- ./
git ls-tree --full-tree -r --name-only HEAD
git tag -a <tag/version> -m "your message"
To list tags, use:
git tag
git remote add origin URL
git remote -v # verify
# first push
git push -u origin master