git --version
mkdir learn_git
cd learn_git
ls -al
git init
ls -al
git config --global user.name "wuyong"
git config --global user.email [email protected]
git config --global --list
git status
pwd
git status
git add learn_git.html
git status
git commit -m "create learn_git.html"
git status
git add .
git status
git commit -m "web1.0"
git add learn_git.html
git commit -m "web2.0"
git log
HTTPS
https://github.com/wuyong/learn_git.git
SSH
[email protected]:wuyong/learn_git.git
…or create a new repository on the command line
echo "# learn_git" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin [email protected]:wuyong/learn_git.git
git push -u origin master
…or push an existing repository from the command line
git remote add origin [email protected]:wuyong/learn_git.git
git push -u origin master
ls -al ~/.ssh
ssh-keygen -t rsa -b 4096 -C "[email protected]"
eval "$(ssh-agent -s)"
open ~/.ssh/config
touch ~/.ssh/config
open ~/.ssh/config
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
ssh-add -K ~/.ssh/id_rsa
pbcopy < ~/.ssh/id_rsa.pub
ssh -T [email protected]
git remote add origin [email protected]:wuyong/learn_git.git
git push -u origin master
git add learn_git.html
git commit -m "web3.0"
git push -u origin master
git log