1. Generate my keys both public and private
ssh-keygen -t rsa -C "your_email@example.com"
2. Start ssh agent in the background and add ssh private key
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/github
3. See the public key content
cat github.pub
4. Go to github website and add public key there.
5. Go to repository and use the SSH version "git@github.com:USERNAME/REPOSITORY.git"
6. Set origin url with repository address
Git remote set-url origin git@github.com:USERNAME/REPOSITORY.git
7. Check if it is all right.
Git remote -v
--------------------------------------------------------------------------------------------------------
Tips:
1. Clone specific branch
git clone -b <branch> <remote_repo>
2. See history (make sure you are in a folder with ".git")
git log
No comments:
Post a Comment