2 Replies Latest reply on Nov 16, 2015 11:11 AM by jason.marley

    best practice for forking, cloning and pushing

    jason.marley

      Hi All,

       

      What is the best way to set up a team development environment? A colleague and myself are currently scoping CouchBase and our first step is setting up a reusable dev environment. We are planning on using Vagrant with RHEL 7.

       

      My question is, should my colleague and individually fork the latest build branch then push up any changes to the branch as we move along or should I fork the branch then my colleague and I work off of my branch then push up to the project? 

       

      Thanks,
      Jason

        • 1. Re: best practice for forking, cloning and pushing
          rareddy

          Jason,

           

          Since we do not know the feature providing the two individual pull requests that are intermingled does not make sense. So you should

           

          1) You should fork upstream project. Then create a branch say "My Cool Feature". This branch is your "origin", and where you forked is "upstream".

          2) Then your colleague should fork your "My Cool Feature" branch. Then that is his/her "origin", and his/her "upstream" is your fork.

          3) Then you commit your code changes either directly or through another branch into "My Cool feature"

          4) You colleague will submit his/her changes in the form of pull request to you, and you will take ownership of that pull and review and merge into "My Cool Feature"

          5) Then you update your copy with a "git pull origin (master|branch)" command to get your colleagues changes into your branch

          6) Your colleague one you merge does "git pull upstream (master|branch)" to update his/her copy to get the latest.

          7) Repeat  steps 3-6 until you are done with project, then from the "My Cool Feature" branch submit a pull request to the upstream project for project leads to accept your contribution.

           

          see how to add "upstream" tag to repo here ModeShape Development Workflow typically it is "git remote add upstream URL", origin is implicitly created with the fork.

           

          Hope this helps.

           

          Ramesh..

          • 2. Re: best practice for forking, cloning and pushing
            jason.marley

            Perfect thanks!