###給遠程添加 倉庫路徑
git remote add origin https://github.com//
origin 就是后面那個遠程地址的別名 以后操作這個就行,比如push和pull的時候
###給移除遠程倉庫地址
git remote remove <name>
##查看遠程倉庫 所有遠程地址
git remote -v
##push
git push origin master-local-branch-name:remote-branch-name
git push origin origin-authority? 表示提交到remote遠程上 和本地一樣的origin-authority分支 沒有則創(chuàng)建
其中origin是遠程地址 一般用這個默認代表
##查看分支情況
git branch
##創(chuàng)建分支
git branch create-name
##切換分支 git checkout? 分支名
git checkout dev-name
##查看修改在緩存區(qū)的文件情況,和未提交狀態(tài)
git status
##查看提交情況
git log
##查看 所有的記錄包括reset 回去的
git reflog
## 提交到緩存區(qū)
git add 文件名
###提交到暫存區(qū) 所有
git add -A
##提交到版本庫
git commit
###提交到版本庫所有
git commit -a
##已經(jīng)add到暫存區(qū)了,但是想刪除這個,回到工作區(qū)的狀態(tài)
git reset HEAD <file>...
##已經(jīng)add到暫存區(qū)了,但是在暫存區(qū)又修改了這個,還沒有
##add操作,想回到最初add到暫存區(qū)的狀態(tài)
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
git checkout -- <file> ##有-- 這個 ,不然會認為切換分支
##其實都有提示使用git status 命令
##查看差異 兩個不同的文件,在add到暫存區(qū)
git diff c-name