git add *? ? ? ? ? 添加所有文件到緩沖區(qū)????
git status? ? ? ? 查看當(dāng)前狀態(tài)
git branch? ? ? ? 查看當(dāng)前所有分支
git branch s1? ? 創(chuàng)建一個(gè)名為s1的分支
git branch -D s1? 刪除本一個(gè)名為s1的分支
git checkout s1? 切換到名為s1的分支
git checkout s1.php? 撤銷對s1.php文件的所有修改操作
git checkout -b s1? 創(chuàng)建并切換到名為s1的分支
git clone http://xxxx? 從xxx倉庫上下載文件
git merge -m 'merge s1 branch' s1? 將s1分支合并到當(dāng)前分支上并備注"merge s1 branch"
git commit -m "123"? 提交文件到緩存區(qū)并備注 123
git push? ?提交緩存區(qū)的文件到倉庫 ,緩存區(qū)文件清空
git push -f? ?強(qiáng)制執(zhí)行提交
git push? ?--delete origin s1? 刪除遠(yuǎn)程倉庫origin/s1? 分支
git stash? 暫存當(dāng)前修改內(nèi)容, 必須是已經(jīng)git add過的
git stash pop?:命令恢復(fù)之前緩存的工作目錄,將緩存堆棧中的對應(yīng)stash刪除,并將對應(yīng)修改應(yīng)用到當(dāng)前的工作目錄下,默認(rèn)為第一個(gè)stash,即stash@{0},如果要應(yīng)用并刪除其他stash,命令:git stash pop?stash@{$num} ,比如應(yīng)用并刪除第二個(gè):git stash pop?stash@{1}
git創(chuàng)建分支格式 ( 建議)??
bug分支
? ? ? ? ? ? ? ? ? ? ? ? git checkout -b buxfix/{bug-no}-{short-description}
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 例? ? ?buxfix/1000448-Keyword-query-failed? ? ? ? ? ??
需求分支
? ? ? ? ? ? ? ? ? ? ?git checkout -b feature/{feature-no}-{short-description}
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?例? ? ?feature/1009-new-roleplay-activity
git提交格式 ( 建議)??
bug提交
? ? ? ? ? ? ? ? ? ? ? ? git commit -m 'fix: #{bug-no} {short-description}'
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 例? ? ?fix: #1000448 修復(fù)使用關(guān)鍵字查詢失敗?
需求提交
? ? ? ? ? ? ? ? ? ? ?git commit -m 'feat: #{demand-no}-{short-description}'
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 例? ? ?feat: #1009 完成roleplay顯示頁面