Git Notes
Table of Contents
Resources
- Roger Rudler: git-guide
- Pro Git book
- Oh Shit, Git!?!
- w3schools: git tutorial (Has a cool teach yourself with exercises section)
Change remote URL
git remote set-url <REMOTE_NAME> <REMOTE_URL>
Rename branch
- If current branch
git branch -m new-name
- If not current branch
git -m old-name new-name
Submodules
Adding a submodule
git submodule add <GIT_REPO>
Pull submodules
git submodule update --init --recursive
Delete Remote Branch
git push <REMOTE> --delete <BRANCH>
Magit
Resources
Checking out a file from another branch
- From within the
magit
menu pressX
forReset
commands - From inside the
Reset
commands list pressf
forFile
- Next pick the source branch, then pick the file in the repo
- This will revert that file in the current branch to the version from the other branch as a soft change