Tuesday 2 June 2015

Git and Github: setting up to work on an open source project.

In order to test Git and Github, I created a repository, apqa, featuring a nice vector/math library I wrote a while back.

From a project's owner point of view, committing changes is trivial. However, I am exploring Github from a contributor's point of view.

So, after I created my repository and logged a couple of issues, I logged in as a different user and let's get to work.

Setup: Fork, clone and sync.

[web interface] Fork to create a copy of the target repository on the Github server. Said new copy is linked to your github account.

[web interface] Clone your copy of the repository. This creates a copy inside your local machine.
!!! for this to work, you need to download install github's desktop front end and you should be logged into your user account in both the front end application and the web interface.

[command line] cd to your copy of the repo, then:

 git checkout master
 git remote -v
 git remote add upstream https://github.com/ACME/REPO.git
 git remote -v

And the reply to the latest command should be something like.

 BVLC  https://github.com/ACME/REPO.git (fetch)
 BVLC  https://github.com/ACME/REPO.git (push)
 origin  https://github.com/MY_COMPANY/REPO.git (fetch)
 origin  https://github.com/MY_COMPANY/REPO.git (push)
 upstream https://github.com/BVLC/REPO.git (fetch)

 upstream https://github.com/BVLC/REPO.git (push)

[command line] to update master to the latest changes:

 git fetch upstream
 git checkout master
 git merge upstream/master

References

No comments:

Post a Comment