[pygr-notify] [pygr commit] r205 - Edited wiki page through web user interface.

codesite-noreply at google.com codesite-noreply at google.com
Fri May 1 15:08:14 PDT 2009


Author: cjlee112
Date: Fri May  1 14:32:36 2009
New Revision: 205

Modified:
    wiki/UsingGit.wiki

Log:
Edited wiki page through web user interface.

Modified: wiki/UsingGit.wiki
==============================================================================
--- wiki/UsingGit.wiki	(original)
+++ wiki/UsingGit.wiki	Fri May  1 14:32:36 2009
@@ -6,19 +6,84 @@

  = Overview of How We're Using Git =
  The Pygr project is tiny in comparison with Linux kernel, so we can get  
away with a pretty simple development model:
-  * I own the "master" branch; i.e. all proposed changes pass through me.
-  * I make changes in my git repository.
-  * I push changes to the public git repository.
-  * Anyone else can get their own copy of the repository by using "git  
clone" from the public repository.
-  * Anyone else can create their own branch (in their own git repository),  
to try out changes that they want to make.  *Don't make changes in the  
master branch* as this will complicate your ability to pull from the public  
repository in the future; instead always create a separate branch in which  
to make your changes.  In doing so, you just commit your changes as usual,  
but in your branch, not in the "master" branch.
-  * If you have finalized changes that you want incorporated into the  
master branch, send them to me as email patches.  I will then examine them  
(typically as a temporary branch in my repository), and if I see no  
problems, will merge them into the master branch.
+  * We are using [http://github.com github.com] as our public repository  
server.  Github.com offers a lot of [http://github.com/guides/home great  
tools] for developers to collaborate.
+  * I own the [http://github.com/cjlee112/pygr "official" public git  
repository for pygr]; i.e. all proposed changes pass through me.
+  * Anyone else can  
[http://github.com/guides/fork-a-project-and-submit-your-modifications  
create their own fork of the project on github.com], which will allow you  
to easily create your own experimental branches, tell me when you want me  
to incorporate your changes into the official master branch, and stay in  
synch with my "upstream" repository etc.
+  * If you want to immediately get your hands on the code without creating  
a github.com account, just using "git clone" from  
[http://github.com/cjlee112/pygr the public repository].  Note however that  
without a publicly hosted git repository, you will only be able to share  
your changes with others by sending email patches, without any of github's  
great tools.  If you have any interest in modifying the Pygr source, I  
highly recommend getting a github.com account.  It only takes a minute.
+  * In general, I suggest making changes in a new branch rather than  
*master*.  Making changes in the master branch will complicate your ability  
to pull from the public repository, because you will not be able to keep  
your changes separate from the changes in the public master.  We suggest  
that you always create a separate branch in which to make your changes.  In  
doing so, you just commit your changes as usual, but in your branch, not in  
the master branch.
+  * When the time comes that you want to share your changes with others  
(e.g. get them incorporated in the public master), all you have to do is  
tell us the name of your new branch.  We will then examine them, and merge  
them into the public master branch if there are no issues that need  
discussion first.
    * We can create separate branches for a specific release cycle.  E.g. I  
created a branch v0_7 for bug fixes to version 0.7.  It's trivial to pull  
bug fixes from the master branch into the v0_7 branch, and vice versa.

-= Git Usage Examples =
+
+= Using git with your github.com account =
+The following examples assume you have a github.com account and your own  
fork of the pygr repository in your account.  This allows you both to pull  
future changes from the official repository, and to push your changes to  
your own public repository for others to access.
+
+First, take a look at the [http://github.com/guides/home very helpful  
guides] on github.com.
+
+=== Get a copy of your Pygr fork repository ===
+{{{
+git clone git at github.com:yourname/pygr.git
+}}}
+See github's  
[http://github.com/guides/fork-a-project-and-submit-your-modifications  
helpful instructions] here.
+
+=== Update your master branch from the official master branch ===
+{{{
+git checkout master
+git pull upstream/master
+}}}
+Note that *upstream* is how github refers to the repository you forked  
from (in this case, the official Pygr repository).  So *upstream/master*  
refers to the master branch in the official repository.  The `git pull`  
command will both fetch and merge changes from that branch into your  
current branch (in this case, your master branch).
+
+=== Push your master branch to your github repository ===
+{{{
+git push origin master
+}}}
+Note that *origin* is how github refers to your public repository in your  
github account.
+
+=== Push your current branch to your github repository ===
+{{{
+git push origin HEAD
+}}}
+*HEAD* just refers to the head of your current branch.  If your current  
branch doesn't exist in your github repository, it will be created.
+
+=== Add someone else's fork to your list of remote repositories ===
+{{{
+git remote add -f ctb git://github.com/ctb/pygr.git
+}}}
+In the future we will be able to access Titus' Pygr repository via the  
name *ctb*.  The *-f* option makes git fetch Titus' branches as tracking  
branches in your local repository, e.g. his master branch would be tracked  
in your repository as *ctb/master*.
+
+=== Pull an experimental branch from someone else's fork ===
+Assuming you've already added that person's fork to your list of remote  
repositories as shown in the previous step, all you have to do is get the  
latest remote updates
+{{{
+git remote update
+}}}
+E.g. if Titus has a branch named "seqdb_review", any updates he made in  
that branch will show up in *ctb/seqdb_review* (which simply tracks that  
branch in his repository).
+
+=== View someone else's experimental branch ===
+Using the above procedure, the other person's branches will be mirrored in  
your repository simply prefixed by the name you assigned their remote  
repository (in this case *ctb*).  Knowing that, you can view everything  
they've done in that branch simply by using that branch name, e.g.
+{{{
+git branch -r # list the remote branches your repository is tracking
+git checkout ctb/seqdb_review # look at the current state of his branch
+git log # show the list of commits leading up to his current state
+git diff a17f52 # show diff of his current state vs. a specific commit
+gitk -all # show dependency graph of all commits, including local and  
remote branches
+}}}
+
+=== Add your own changes to someone else's experimental branch ===
+If you wanted to modify that branch, you'd create your own seqdb_review  
branch based on his branch, and start making commits...
+{{{
+git branch seqdb_review ctb/seqdb_review
+git checkout seqdb_review
+}}}
+Now you can start editing and making your own commits in this branch, and  
push it back to your own repository.
+
+In general, this is the best way for two or more people to collaborate on  
an experimental feature: one person creates the experimental branch; other  
people copy it, make their own changes, push the branch to their own github  
repository.  Then everybody can pull from each other's version of this  
experimental branch, make more changes, etc.
+
+= Using git without your own github.com account =
  === Get a copy of the public repository ===
  {{{
-git clone git://repo.or.cz/pygr.git
+git clone git://github.com/cjlee112/pygr.git
  }}}
+In this case, you will be able to pull future changes from the official  
repository, but you won't be able to push your changes back to it.

  === Get the latest changes from the public repository ===
  {{{
@@ -27,10 +92,10 @@
  }}}
  The first command is only necessary if you were previously working on a  
different branch than "master".

+= General git usage =
  === Make an experimental branch and commit changes there ===
  {{{
-git branch trythis
-git checkout trythis
+git checkout -b trythis
  # edit one or more files, test your changes...
  git add pygr/sqlgraph.py tests/nosebase.py # whatever files you changed
  git add tests/new_test.py # you can also add new files to the repository



More information about the pygr-notify mailing list