新建倉庫:git init
拷貝遠程倉庫到本地:git clone https://github.com/wispyoureyes/myblog.git(遠程倉庫地址)
本地倉庫連接遠程倉庫:git remote add origin https://github.com/wispyoureyes/myblog.git(遠程倉庫地址)
將工作區文件改動添加到本地暫存區:git add < file > 將工作區所有改動添加到暫存區:git add .
第一次提交本地代碼到遠程master:git push -u origin master(之后都用git push)
新建分支:git branch new_branch 新建分支并切換到新分支上: git checkout -b new_brnach
刪除遠程分支(刪除master前需要先將主分支設置為其他分支):git push -delete origin master 刪除本地分支: git branch -d master
查看本地分支:git branch 查看包括遠程分支的所有分支:git branch -a
回滾歷史版本到新分支上:git branch new_branch HEAD(SHA)
新聞熱點
疑難解答