Git

Add SSH Keys

Create Repo

Clone

# 如果已经在记录了ssh key的机器上用
git clone [email protected]:lava-lake/llpub.git
# 在随便一台机器上获得public repo
git clone https://github.com/lava-lake/llpub.git

Config User

git config --global user.email "[email protected]"

Add a new file & commit

# get a file to local folder
 touch test.txt   

# check status
 git status

# add file to stage/buffer 
 git add test.txt

# commit changes
 git commit -m 'add test.txt'

# push changes
 git push

Edit & commit

# change file
echo 'new line' >> test.txt

# check status
 git status

# add file to stage/buffer 
 git add test.txt

# commit changes
 git commit -m 'added new line to test.txt'

# push changes
 git push

rm

git rm file.txt
git rm -r folder
git commit -m 'rm a file & folder'
git push

国内机器使用Github的加速配置

Leave a Reply