You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by "Tyagi, Preetika" <pr...@intel.com> on 2018/02/01 05:53:20 UTC

RE: create branch in my github account

Thank you Michael. I was able to create the branch and push my changes! :)

Preetika

-----Original Message-----
From: Michael Shuler [mailto:mshuler@pbandjelly.org] On Behalf Of Michael Shuler
Sent: Tuesday, January 30, 2018 2:04 PM
To: dev@cassandra.apache.org
Subject: Re: create branch in my github account

On 01/30/2018 03:47 PM, Tyagi, Preetika wrote:
> Hi all,
> 
> I'm working on the JIRA ticket CASSANDRA-13981 and pushed a patch 
> yesterday, however, I have been suggested to create a branch in my 
> github account and then push all changes into that. The patch is too 
> big hence this seems to be a better approach. I haven't done it before 
> so wanted to ensure I do it correctly without messing things up :)
> 
> 
> 1.      On Cassandra GitHub: https://github.com/apache/cassandra,
> click on "Fork" to create my own copy in my account.
> 
> 2.      Git clone on the forked branch above

s/branch/repository/ - this is a new forked repo, not a branch

> 3.      Git checkout <commit-id of the version I worked on>

git checkout trunk
  # since 13981 appears to for 4.0 (trunk)
  # if you worked off some random sha, you may need to rebase on
  # trunk HEAD, otherwise it may not cleanly merge and that will be
  # the first patch review request.

git checkout -b CASSANDRA-13981
  # create a new branch

> 4.      Apply my patch
> 
> 5.      Git commit -m "<comments>"
> 
> 6.      Git push origin trunk

git push origin CASSANDRA-13981  # push a new branch to your fork

> Please let me know if you notice any issues. Thanks for your help!

You could do this in your fork on the trunk repository, but it's probably better to create a new branch, so you can fetch changes from the upstream trunk branch and rebase your branch, if that is needed. It is very common to have a number of remotes configured in your local
repository: one for your fork, one for the apache upstream, ones for other user's forks, etc. If you do your work directly in your trunk branch, you'll have conflicts when pulling in new commits from apache/cassandra trunk, for example.

--
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org