标签:cache bottom str com 范围 合并 hub 一个 否则
1 [root@git ~]# cd /mystudy/ 2 [root@git mystudy]# git init 3 [root@git mystudy]# git remote add origin https://gitee.com/imxhy/mystudy
1 [root@git mystudy]# git clone https://gitee.com/xiyouMc/pornhubbot 2 [root@git mystudy]# git clone https://gitee.com/xiyouMc/pornhubbot mystudy #clone项目,同时本地创建mystudy目录。
1 [root@git mystudy]# echo ‘My Project‘ > README 2 [root@git mystudy]# git status
1 [root@git mystudy]# git add README 2 [root@git mystudy]# git status
1 [root@git mystudy]# echo "This is my test file">>README 2 [root@git mystudy]# git status
1 [root@git mystudy]# git add README #添加至暂存区
1 [root@git mystudy]# git status -s
1 [root@git mystudy]# cat .gitignore
1 [root@git mystudy]# echo "Hello" > README 2 [root@git mystudy]# echo "Hello" > CONTRIBUTING.md 3 [root@git mystudy]# git add README 4 [root@git mystudy]# git status
1 [root@git mystudy]# git diff #通过git diff查看具体做了哪些修改。
1 [root@git mystudy]# git status
1 [root@git mystudy]# git commit
1 [root@git mystudy]# git mv README README.md
1 $ mv README README.md 2 $ git rm README 3 $ git add README.md
1 [root@git mystudy]# git log
1 [root@git mystudy]# git commit -m ‘first commit‘ 2 [root@git mystudy]# echo "This is my test 3 file" > README3.md 3 [root@git mystudy]# git add README3.md 4 [root@git mystudy]# git commit --amend -m ‘second commit‘
1 [root@git mystudy]# echo "This is my test 4 file" > README4.md 2 [root@git mystudy]# echo "This is my test 5 file" > README5.md 3 [root@git mystudy]# git add * 4 [root@git mystudy]# git status 5 [root@git mystudy]# git reset HEAD README5.md #从暂存区取消特定文件
1 [root@git mystudy]# echo "version 1.1" > version.md 2 [root@git mystudy]# git add version.md 3 [root@git mystudy]# git commit -m ‘version commit‘ 4 [root@git mystudy]# echo "version 2.2" > version.md 5 [root@git mystudy]# git status
1 [root@git mystudy]# cat version.md 2 version 2.2 3 [root@git mystudy]# git checkout -- version.md 4 [root@git mystudy]# git status
1 [root@git mystudy]# git remote -v
1 [root@git mystudy]# mkdir /mystudy2 2 [root@git mystudy]# cd /mystudy2 3 [root@git mystudy2]# git init 4 [root@git mystudy2]# git remote add mystudy2 https://gitee.com/imxhy/mystudy2 5 [root@git mystudy2]# git fetch mystudy2 #使用别名拉取仓库存在但本地没有的文件
1 [root@git mystudy2]# git push mystudy2 mystudy2/master
1 [root@git mystudy2]# git remote show mystudy2
1 [root@git mystudy2]# git remote rename mystudy2 study2 2 [root@git mystudy2]# git remote 3 study2
1 [root@git mystudy2]# git remote rm study2 2 [root@git mystudy2]# git remote
1 [root@git mystudy]# git config --global alias.co checkout 2 [root@git mystudy]# git config --global alias.br branch 3 [root@git mystudy]# git config --global alias.ci commit 4 [root@git mystudy]# git config --global alias.st status
标签:cache bottom str com 范围 合并 hub 一个 否则
原文地址:https://www.cnblogs.com/itzgr/p/9910558.html