git总结

git客户端配置

cd ~

git config --global user.name "<USERNAME>"

git config --global user.email "<EMAIL>"

ssh-keygen -t rsa -C "<EMAIL>" -b 4096

cat ~/.ssh/id_rsa.pub

 

git使用

git clone <URL> ./

 

git remote [-v]

git remote show origin

git branch [-a]

 

git checkout -b <BRANCH_NAME> origin/<BRANCH_NAME>

 

git branch <NEW_COPY_BRANCH_NAME>

git chekcout <NEW_COPY_BRANCH_NAME>

git push origin <NEW_COPY_BRANCH_NAME>

git branch -u origin/<NEW_COPY_BRANCH_NAME>

 

git branch -vvv

 

git branch -d <BRANCH_NAME>

git push origin -d <BRANCH_NAME>

 

git branch -a

git remote prune origin

 

git pull

git fetch origin

git merge <BRANCH_NAME>

git status

git add <FILE_NAMEs>

git commit -m "COMMIT_MESSAGE"

git log

git push

 

git reset --hard

 

 

posted @ 2019-01-25 19:26  tom_first  阅读(100)  评论(0)    收藏  举报