@zhongjianxin
2019-10-11T03:40:40.000000Z
字数 1204
阅读 853
AFS-HW-Java

Practice:
1. 在github上创建一个repo(gittest).
2. 创建一个本地仓库,并将本地仓库推向远端repo. (
git inittouch readme.mdgit add .git commit -m "initiate the project"git add remote origin [url]]git push -u originorgit push --set-upstream origin master
commit 1 in browsercommit 2 in cligit pullgit pushcommit 2 in browsergit fetchgit merge
conflict handlecommit 3 update text in browsercommit 3 update the same text in cligit fetchgit merge ------>conflicthandle conflictgit push
再git clone一个repo
git branch -b newbranchname
git fetch
在命令行查看本地和远程的所有branch
# 列出所有本地分支$ git branch# 列出所有远程分支$ git branch -r# 列出所有本地分支和远程分支$ git branch -a# 新建一个分支,但依然停留在当前分支$ git branch [branch-name]# 新建一个分支,并切换到该分支$ git checkout -b [branch]
git log --pretty=oneline
git pull 相当于 git fetch + git merge类似地,git pull --rebase 相当于 git fetch + git rebasefetch 只是获取 HEAD 指针,而不会更新代码https://blog.csdn.net/weixin_41975655/article/details/82887273
git rebasehttps://www.jianshu.com/p/dc367c8dca8e