software:cli:git
Table of Contents
Github
set url and ssh keys to push using ssh
ssh-keygen -t rsa -C "your_email@example.com" cat ~/.ssh/id_rsa.pub
Copy the content in the SSH keys of your Github profile
Test:
ssh -T git@github.com
push changes
in your local copy of the repository:
git remote set-url origin git@github.com:username/your-repository.git
Then once you changed something
git commit -am "your comment" git push
GIT Merge conflict
git config merge.tool vimdiff git config merge.conflictstyle diff3 git config mergetool.prompt false
Navigate using Ctl+W between LOcal BAse REmote
or MErge windows displayed like so:
╔═══════╦══════╦════════╗ ║ ║ ║ ║ ║ LOCAL ║ BASE ║ REMOTE ║ ║ ║ ║ ║ ╠═══════╩══════╩════════╣ ║ ║ ║ MERGED ║ ║ ║ ╚═══════════════════════╝
If you want to get changes from REMOTE
:diffg RE
If you want to get changes from BASE
:diffg BA
If you want to get changes from LOCAL
:diffg LO
Once the MErged windows looks like what you want
Step 5. Save, Exit, Commit and Clean up
:wqa
save and exit from vi
git commit -m "message"
git clean
Remove extra files (e.g. *.orig) created by diff tool.
Reference
software/cli/git.txt · Last modified: 2021/12/29 21:09 by warnaud