So to take a step further, I thought of going into cassandra development. In this article, I will describe how I got source from cassandra official git repository and setup my own repository in github , so to coexist both of them.
Previously I have done git clone http://git-wip-us.apache.org/repos/asf/cassandra.git
user@localhost:~/cassandra-trunk$ git remote -v
origin http://git-wip-us.apache.org/repos/asf/cassandra.git (fetch)
origin http://git-wip-us.apache.org/repos/asf/cassandra.git (push)
So pretty much usual. Now, let's change to the follow
* origin point to github repository
* upstream point to github repository
First, let's remove the remote origin and then add my repository in github. Of cause, create an empty repository in github first before you continue following.
Now, let's check the remote origin.
okay, everything is on track and expected. Now let's add upstream to the cassandra git repository.
and then we check again.
OK! everything is good to go. okay.. now that we have two remote repositories, so how should we continue to work further? Now, when we pull, we have to first specify where to pull from and what branch to pull. In the following example, we pull from upstream on the trunk (master) branch.
beautiful, now we can pull from upstream and into our working repository. Let's push our repository into github now.
okay, that's it, one more step ahead.
* origin point to github repository
* upstream point to github repository
First, let's remove the remote origin and then add my repository in github. Of cause, create an empty repository in github first before you continue following.
user@localhost:~/cassandra-trunk$ git remote remove origin
user@localhost:~/cassandra-trunk$ git remote add origin https://github.com/jasonwee/cassandra.git
Now, let's check the remote origin.
user@localhost:~/cassandra-trunk$ git remote -v
origin https://github.com/jasonwee/cassandra.git (fetch)
origin https://github.com/jasonwee/cassandra.git (push)
okay, everything is on track and expected. Now let's add upstream to the cassandra git repository.
user@localhost:~/cassandra-trunk$ git remote add upstream http://git-wip-us.apache.org/repos/asf/cassandra.git
and then we check again.
user@localhost:~/workspace/StudyCassandra/cassandra-trunk$ git remote -v
origin https://github.com/jasonwee/cassandra.git (fetch)
origin https://github.com/jasonwee/cassandra.git (push)
upstream http://git-wip-us.apache.org/repos/asf/cassandra.git (fetch)
upstream http://git-wip-us.apache.org/repos/asf/cassandra.git (push)
OK! everything is good to go. okay.. now that we have two remote repositories, so how should we continue to work further? Now, when we pull, we have to first specify where to pull from and what branch to pull. In the following example, we pull from upstream on the trunk (master) branch.
user@localhost:~/cassandra-trunk$ git pull upstream trunk
From http://git-wip-us.apache.org/repos/asf/cassandra
* branch trunk -> FETCH_HEAD
Already up-to-date.
beautiful, now we can pull from upstream and into our working repository. Let's push our repository into github now.
user@localhost:~/cassandra-trunk$ git push -u origin trunk
Counting objects: 266270, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (42703/42703), done.
Writing objects: 100% (266270/266270), 136.16 MiB | 547.00 KiB/s, done.
Total 266270 (delta 160130), reused 265316 (delta 159364)
remote: Resolving deltas: 100% (160130/160130), done.
To https://github.com/jasonwee/cassandra.git
* [new branch] trunk -> trunk
Branch trunk set up to track remote branch trunk from origin.
okay, that's it, one more step ahead.
No comments:
Post a Comment