For security reasons, it's better to generate the keys locally.
cd ~/.ssh
ssh-keygen -t rsa -b 4096 -C "[email protected]"Use a name like hosting-key.
For security reasons, it's better to generate the keys locally.
cd ~/.ssh
ssh-keygen -t rsa -b 4096 -C "[email protected]"Use a name like hosting-key.
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
There are numerous reasons you may need to use multiple SSH keys for accessing GitHub and BitBucket
You may use the same computer for work and personal development and need to separate your work.
When acting as a consultant, it is common to have multiple GitHub and/or BitBucket accounts depending on which client you may be working for.
You may have different projects you're working on where you would like to segregate your access.
Remove all untracked local branches:
git checkout master
git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D
Another way:
git fetch -p ; git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d