GIT命令备忘

来源:互联网 发布:高程测量记录表的算法 编辑:程序博客网 时间:2024/06/05 14:20

查看本地分支

git branch


查看远程分支

git branch -r


checkout 远程分支并在本地创建新分支

git checkout -b ${local_branch}  ${remote_repo}/${remote_branch}

例如 git checkout -b cassandra-3.3  origin/cassandra-3.3


查看tag

git tag -l


checkout tag

git checkout tags/${target_tag}

git checkout tags/${target_tag} -b ${local_branch}


比较commit,并创建patch

git diff commit1_hash commit2_hash > your.patch


应用patch

git apply <yourpath>


0 0
原创粉丝点击