Git-flow常用命令

Version: git version 2.14.3 (Apple Git-98)

分支(branch)

  git checkout -B branch_name // 本地创建分支,并切换到该分分支
  git push origin --delete branch_name  //删除远程分支
  git fetch -p // 获取远程更新,并且删除已经不在远程存在的分支
  git branch -D branch_name  // 删除本地分支

Tag

terminal: git tag 1.1.1                 // 创建一个新的tag,为 1.1.1     
terminal: git push origin --tags        // 将本地的tag推送到远程
terminal: git tag -d 1.1.1              //删除本地名为1.1.1的tag
terminal: git push origin --delete tag 1.1.1  //删除远程tag 1.1.1

设置多个Gitconfig的user和email

我们平常开发中,在公司使用的是公司的账号和用户名, 我们发布Code到我们自己的Github上需要切换到自己的账号和用户名, 如何区分使用?
全局: git config

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

单个工程: 在需要使用其他账号和邮箱的项目目录中, 单独为当前设置账户和邮箱

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:

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1.git的安装 1.1 在Windows上安装Git msysgit是Windows版的Git,从https:/...
    落魂灬阅读 14,339评论 4 54
  • 分布式版本管理工具 git属于分布式 svn集中式 git安装 git初始化一个仓库 其实就是创建了一个.git隐...
    SnowDragonYY阅读 5,366评论 0 0
  • git常用命令 GIT常用命令备忘:http://stormzhang.com/git/2014/01/27/gi...
    新篇章阅读 12,766评论 1 26
  • ——裸职的第55天 近日挑战:个人管理(四) 积极的心理暗示不是一味喝鸡汤和打鸡血,是用嘴巴和意识给你的脑袋你的身...
    幕小沐阅读 3,301评论 2 2
  • 文/小花 时间在走,你会不会一直牵着我的手? ❤ 亲爱的周同学: 你好吗?嗯……我知道你很好,因为昨天我们才通过电...
    蔓语悠悠阅读 5,154评论 19 20