SUPPORT THE SITE WITH A CLICK

Subscribe Rss:

SUPPORT THE SITE WITH A CLICK

Monday, November 22, 2010

How to use github and fork a project

Since i have changed my concern, i have to hardly switch over to java.But i don't have any interest in java.So i decided to practice rails, then finally i got the advertisement for ror_ecommerce.

As i am working in a leading service based company, i don't find any good tools for source control.But now almost all the developers are started using Github.

When we are going to work with others repos, then we have to fork their project.So that we can parallely work on it and submit our patches to them.First thing, you need to have a github account, if you don’t have one yet then just signup for github public account.



Now we have our own forked repo


Now we have to clone the fork locally, so try to use Private URL and avoid using Public URL.

$ git clone git@github.com:genlinux/ror_ecommerce.git


Now we can do our changes in this repository, but we have to track the latest updates from ror_ecommerce original repo, since core team makes any change to the code.

$ git remote add coreteam git://github.com/drhenner/ror_ecommerce.git

Now its adds to the .git/config file

[remote "coreteam"]
url = git://github.com/drhenner/ror_ecommerce.git
fetch = +refs/heads/*:refs/remotes/coreteam/*


Finally on pushing your code changes you will finding the permission denied error.If u have permission no issue with that.If not then edit the text in .git/config from


[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:drhenner/ror_ecommerce.git


to


[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:genlinux/ror_ecommerce.git


then
$ git fetch coreteam


and
git checkout -b coreteam coreteam/master


Thats it finally we can our local change to your remote repo at github , then inform the project owner of the changes so they can pull them into their repo.We can do the pull request through the github site itself.






References:

1.Gitref - http://gitref.org/
2.Forking - Forking

2 comments :

  1. $ git fetch upstream

    This command is not correct use:

    $ git fetch coreteam

    ReplyDelete
  2. Thanks for notifying the mistake

    ReplyDelete