当前位置: 代码迷 >> 综合 >> GIT 常用命令(个人工作记载)
  详细解决方案

GIT 常用命令(个人工作记载)

热度:40   发布时间:2023-12-14 23:36:08.0

新建本地分支追踪远程分支

git checkout -b 本地分支名x origin/远程分支名x

新建本地分支追踪TAG

git checkout -b 本地分支名x 标签名

回滚到某一次版本

git log 查找版本号
git reset --hard 版本号

修改分支名称

git branch -m oldName newName

GIT 查看两个版本之间的差异文件

git diff hash1 hash2 --stat

更新远程分支到本地

git remote update origin --prune