Git-flow常用命令

Version: git version 2.14.3 (Apple Git-98)

分支(branch)

  git checkout -B branch_name // 本地創(chuàng)建分支,并切換到該分分支
  git push origin --delete branch_name  //刪除遠(yuǎn)程分支
  git fetch -p // 獲取遠(yuǎn)程更新,并且刪除已經(jīng)不在遠(yuǎn)程存在的分支
  git branch -D branch_name  // 刪除本地分支

Tag

terminal: git tag 1.1.1                 // 創(chuàng)建一個新的tag,為 1.1.1     
terminal: git push origin --tags        // 將本地的tag推送到遠(yuǎn)程
terminal: git tag -d 1.1.1              //刪除本地名為1.1.1的tag
terminal: git push origin --delete tag 1.1.1  //刪除遠(yuǎn)程tag 1.1.1

設(shè)置多個Gitconfig的user和email

我們平常開發(fā)中,在公司使用的是公司的賬號和用戶名, 我們發(fā)布Code到我們自己的Github上需要切換到自己的賬號和用戶名, 如何區(qū)分使用?
全局: git config

git config --global user.name "Your Name Here"
git config --global user.email your@email.com

單個工程: 在需要使用其他賬號和郵箱的項目目錄中, 單獨為當(dāng)前設(shè)置賬戶和郵箱

git config user.name "Your Name Here"
git config user.email your@email.com

git修改已提交commit的author

https://makandracards.com/makandra/1717-git-change-author-of-a-commit

Q:丟棄所有 untracked files?

   git clean -f

Q:git修改已提交commit的author

git commit --amend -m "Inital init" --author="mistdon <wonderland.don@gmail.com>"

A: git-change-author-of-a-commit

Reference:

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

推薦閱讀更多精彩內(nèi)容

  • 1.git的安裝 1.1 在Windows上安裝Git msysgit是Windows版的Git,從https:/...
    落魂灬閱讀 12,718評論 4 54
  • 分布式版本管理工具 git屬于分布式 svn集中式 git安裝 git初始化一個倉庫 其實就是創(chuàng)建了一個.git隱...
    SnowDragonYY閱讀 1,515評論 0 0
  • git常用命令 GIT常用命令備忘:http://stormzhang.com/git/2014/01/27/gi...
    新篇章閱讀 8,648評論 1 26
  • ——裸職的第55天 近日挑戰(zhàn):個人管理(四) 積極的心理暗示不是一味喝雞湯和打雞血,是用嘴巴和意識給你的腦袋你的身...
    幕小沐閱讀 479評論 2 2
  • 文/小花 時間在走,你會不會一直牽著我的手? ? 親愛的周同學(xué): 你好嗎?嗯……我知道你很好,因為昨天我們才通過電...
    蔓語悠悠閱讀 1,291評論 19 20