Git Notes
<2022-05-01 Sun>
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
Checking out a file from another branch
- From within the
magit menu press X for Reset commands
- From inside the
Reset commands list press f for File
- 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