git 学习记录

原创
2017/08/20 13:05
阅读数 79

git工作流

    团队之间成员之间互相协作, git工作流是一套方法流.

    http://blog.jobbole.com/76843/  Git工作流指南

    http://blog.jobbole.com/76861/ Git工作流指南:Forking工作流

    http://blog.jobbole.com/76867/ Git工作流指南:Gitflow工作流

    http://blog.jobbole.com/76857/ Git工作流指南:功能分支工作流

    http://blog.jobbole.com/76847/ Git工作流指南:集中式工作流

    http://www.cnblogs.com/cnblogsfans/p/5075073.html  Git 在团队中的最佳实践--如何正确使用Git Flow

技巧

    1. 已经 commit, 没有push,撤销 commit,保留了你之前 commit 的代码.

       git reset <commit_id>

    2. 已经 push,撤销commit,回到某个commit.

        这种操作会撤销到上一次的 commit,随之的也是你上次的 commit 修改的代码会消失. 

        git reset --hard <commit_id>

        git push origin HEAD --force

    3. 拉取某个分支的 commit.(http://www.cnblogs.com/0201zcr/p/5752771.html)

        git cherry-pick <commit id>

        git cherry-pick <多个commit id>

        20c2f506d789bb9f041050dc2c1e954fa3fb6910

        2633961a16b0dda7b767b9264662223a2874dfa9

        5d5929eafd1b03fd4e7b6aa15a6c571fbcb3ceb4

工具

    1. Android Studio 自带 git.

    2. SourceTree 也不错.

资料

    https://github.com/TeamStuQ/skill-map/blob/master/data/map-Git.md

    

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部