I am finally making myself learn the git command line instead of just using a UI so that I can actually understand what git is really doing. Plus I have started playing a lot with the IonicBox and running a Ubuntu vagrant controlled VM for this
blog and both of those are just linux shell command prompt only machines.
Below are my notes on various commands so that I can stop having to Google each time I forgot one of them.
To cache credentials for 1 hour. The timeout is in seconds.
In Git terms, this is called cloning a repository and the command to use is git clone.
Directory name will match repository name
git clone [Remote Repository Url]
Use this command if you want to name the directory different than the repository name
git clone [Remote Repository Url] [Directory to Clone into]
Where did the local repository come from?
git remote -v
Change the Remote Origin Url
git remote set-url origin [https or ssh url]
Get Latest Changes but don’t merge
Get Latest Changes and Merge
Generate SSH Keys
ls -al ~/.ssh
ssh-keygen -t rsa -C "email@example.com"
ssh-agent -s or eval(ssh-agent) or eval $(ssh-agent)
clip < ~/.ssh/id_rsa.pub
Go to github settings for your account
Click on SSH Keys
Click Add Key
Give it a name and paste in the key
Put in your github password
ssh -T firstname.lastname@example.org
Should get a response like: Hi username! You’ve successfully authenticated, but GitHub does not provide shell access.