Make an additional commit on the most recent one, without making a new commit
Make changes you want locally
git add -u
git commit --amend --no-edit
git push origin -f 4704-feature
Merge changes from one branch to another
git checkout release
git pull
git checkout coAppValidations
git merge release
git add .
// Go to VScode, and accept all incoming changes for build.js
// Go to other conflicted files, and copy the differences to an online diff tool
// Manually decide what changes you want to keep
git commit, and git push
[user]
name = Timothy Lim
email = timothylim23@gmail.com
Setting up Multiple Git Configs
Setting up two ssh keys: https://gist.github.com/jexchan/2351996
To use a particular user (Waleed-Chaudhry is the user here) for a given repo
Go to the repo
vi .git/config
Switch url from git@github.com:Waleed-Chaudhry/jQuery.git to git@github.com-Waleed-Chaudhry:Waleed-Chaudhry/jQuery.git
Or https://github.com/timothyylim/axo-minside-private to https://github.com-timothyylim/timothyylim/axo-minside-private
Migrate a repo from bitbucket to git
Waleeds-MacBook-Pro:~ Waleed$ cd Code/
Waleeds-MacBook-Pro:Code Waleed$ git clone --mirror https://timothyylim@bitbucket.org/axofinans/axofinans-no-nyweb.git
Waleeds-MacBook-Pro:Code Waleed$ cd axofinans-no-nyweb/
Waleeds-MacBook-Pro:axofinans-no-nyweb Waleed$ git remote set-url --push origin https://github.com/timothyylim/axo-minside-private.git
Make sure you have given collab permissions to the user you're about to push before doing the next step
git push --mirror
Delete the repo you had, and git clone the new one
Submodules
git submodule update --init --recursive
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule <name>"
- Delete the now untracked submodule files rm -rf path_to_submodule