美文网首页
git工具命令总结

git工具命令总结

作者: 宇辰妈咪 | 来源:发表于2020-05-29 09:14 被阅读0次

    1.做TAG两步:

    repo forall -c git tag -a tag名字 -m "commit信息"

    repo forall -c git push --tags

    repo forall -c git tag -a 2018_03_29_mark -m "make this tag for milestone"

    2.git查看本地所有修改:

    在android目录下输入命令,存储到1.log文件中:

    repo forall -c git status >1.log

    3.git删除代码上传:

    1.git add -A

    2.git commit -m""

    3.git push

    4.Git命令切换分支:

    首先通过

    $ git branch -a

    来查看所在目录的分支

    $ git branch -a

    master

    * trunk

    remotes/origin/HEAD -> origin/master

    remotes/origin/master

    remotes/origin/test

    然后输入命令切换分支

    $ git checkout -b zhanghanlun origin/test

    切换到origin/test分支命令本地分支为”test”

    5.git拷贝别的分支上传代码到本分支 git cherry-pick步骤:

    <1>.git pull (作用是为了拉取所有branch的最新修改)

    <2>.git cherry-pick "commit id"

        git cherry-pick b8c8a5f4736839229dc91006f6e74c10efb91cfb

    <3>. git status ,如果有冲突处理冲突,做上传处理(git add. or git add -u ,git commit)

    <4>.无冲突直接git push

    <5>.查看git history 是否已经正确cherry-pick

    相关文章

      网友评论

          本文标题:git工具命令总结

          本文链接:https://www.haomeiwen.com/subject/mnotzhtx.html