GitHub

From setiquest wiki

Revision as of 17:23, 7 October 2011 by Waldir (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

GitHub "social coding" is a web-based hosting service for projects that use the Git revision control system. Source code can be downloaded, browsed, checked in (committed), merged, forked, and monitored. SonATA and several other setiQuest open source software projects are hosted at GitHub.

The SonATA repository at GitHub uses the Fork + Pull Model. This means that potential contributors first fork a copy of the master setiQuest/SonATA code base, make modifications to their local copy, then they issue a pull request for their modifications to be accepted into the master code base. The core-setiQuest developers with commit access will then decide whether to accept or reject the pull request.

Contents

Network graph

Here is a network graph that shows the activity of the SonATA repository. SonATA github network graph.png

Hosted projects

The following setiQuest open source projects are hosted on GitHub:

Tutorial

Here are some setup steps and git commands to get you started using the GitHub source code control system.

  1. Create a GitHub account (username) and setup the SSH keys.
  2. Github watch fork.png
    Go to https://github.com/setiQuest/SonATA and press the Fork button to create your own personal SonATA code branch on GitHub.
  3. From a Linux shell do git clone git@github.com:username/SonATA.git to download a local copy of your code branch. You'll need to replace "username" with your GitHub user name.
  4. Setup git with your name and email address
    1. git config --global user.name "Your Name"
    2. git config --global user.email "your@email.com"
  5. cd SonATA
  6. For syncing with the main setiQuest branch do git remote add upstream git://github.com/setiQuest/SonATA.git to create a remote link.
  7. Do a scripts/reconfig, make, perform some changes to the code, ...
    1. Modify or create a file and then push it to your SonATA fork on GitHub.
      1. git add new_or_existing_file.c
      2. git commit
      3. git push origin master
    2. Github pull request.png
      Request that your changes be committed to the main setiQuest branch by pressing the Pull Request button on the GitHub website. Your modifications are now in limbo (an uncertain period of awaiting a decision or resolution). The setiQuest commit team will review your changes and possibly accept them.
    3. Occasionally you will want to sync up your fork to the main setiQuest SonATA branch and pull down any official changes by doing git pull upstream master which is the equivalent of manually doing:
      1. git fetch upstream
      2. git merge upstream/master
    4. Git log graph colorful.png
      Here are some useful queries you can do to see the git state of things:
      git remote -v to see your fetch and push remotes
      git status to see what you have recently changed
      git log to see a list of all committed changes done to your fork
      git log --stat a more detailed list of all committed changes done to your fork
      git log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s" a colorful text-base graph of changes. See image on the right.

Using Git with Eclipse

To effectively use Git with Eclipse projects you need to use an Eclipse plugin called EGit. See a tutorial at http://www.vogella.de/articles/EGit/article.html#eclipseinstallation

Install EGit and from Eclipse clone your repository.

You need to get to the point where you can do ALL Git operations from Eclipse. Using Git from the command line and then using the workspace in Eclipse does not work sometimes. 24.32.32.120 11:36, 13 June 2011 (PDT)

Using Git to commit and push

All Git commands are accessible by selecting the project and pressing the right mouse button -> Team.

Git-push-pul-commit.png

"Push to Upstream" is actually a standard "push". So remember, you commit, then push.

See also

External links

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox