Git: Manage each version of my app?

前端 未结 4 1728
长发绾君心
长发绾君心 2021-01-30 03:09

I am using git and github, and I just finished the 1.0 version of my iOS app. From here, I am wondering how git can best serve me.

I really am just looking for a best p

相关标签:
4条回答
  • 2021-01-30 03:52

    I would recommend using tags (tag tutorial)

    From your master branch since you are done v1.0 add a tag called v1.0.

    git tag -a v1.0 -m "Tagging release 1.0"
    

    This way you can always come back to a specific version at any time by calling git checkout [tag_name]

    Another common practice is to use branches to work on features until they are stable.

    git checkout -b [feature-branch]
    

    That creates a new branch named whatever is in [feature-branch] and checks it out. Be sure to do this from where you want to start working on the feature (typically from master).

    Once stable they can then be safely merged into master. From master run:

    git merge [feature-branch]
    

    This way your master branch always stays in a working state and only completed items get added once ready. This will allow you to keep a working copy of the app at all times (ideally anyways) for testing, etc.

    You could use branches for each version of the application however using tags makes it so you can't merge into another branch version by accident.

    0 讨论(0)
  • 2021-01-30 03:55

    It depends on if you want to maintain older versions with bug fixes only. If you want to add bug fixes to 1.0 while adding new features to 2.0, you create a 2.0 branch, merge all bug fixes into both branches, and features into 2.0. But for each release within each branch all you need is a tag. Just remember to branch from the oldest branch you intend to merge back into.

    0 讨论(0)
  • 2021-01-30 04:02

    You can also use the new GitHub releases mechanism. It is a way of managing software versions with GitHub.

    0 讨论(0)
  • 2021-01-30 04:03

    Personally, for large projects I've adopted most of the methods shown in this article:

    http://nvie.com/posts/a-successful-git-branching-model/

    It has worked out really well for me, and now there are even libraries and tools to help you follow along with the methodology: http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/

    0 讨论(0)
提交回复
热议问题