Search Unity

What’s the process for adding code and keeping FPS.sample up to date?

Discussion in 'FPS.Sample Game' started by arkon, Mar 13, 2019.

  1. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    ok, this might be a daft question but I’ve started changing FPS.sample and adding my own code, maps, weapons, characters etc. what happens when unity release the next version of FPS.sample? Won’t git overwrite all my changes on the next “pull”? I’d want any improvements to the net code etc but not lose my changes.

    What is the normal process for this?
     
  2. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Normal process is making your own git fork, creating a new branch from the version you based your work for, applying your changes and submitting them in as commits for that branch. Then when new version comes, you can fetch the changes from the remote upstream (unity's FPSSample repo in this case) and then you can merge the changes to either that custom branch of yours or create new branch based on the new version and cherry-pick the commits you made for the earlier branch. There usually will be merge conflicts which you then usually resolve using some mergetool (I personally use old kdiff3, mainly because I'm used to it).
     
  3. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    thanks for the answer rizu. Can the git fork I make be kept locally on my machine or does it have to be uploaded to git?
     
  4. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Well, you have few options for that, if you don't even plan to push your changes to github, just clone the FPS sample normally with git and make a custom branch with it, then you can just use master branch to sync the actual Unity's work.

    If you want to push something to github, doing a fork using github website is easier as then you can push your changes to that if needed. Editing your fork locally is possible though, just don't push the changes to git if you wan to keep them local.