getting going with git / github / forked repository

2 views
Skip to first unread message

Rich E

unread,
Aug 1, 2010, 11:03:31 AM8/1/10
to pymt...@googlegroups.com
I know this was almost too simple to make a forked repository, but I did one for the slider-color-down (issue 285) style attribute so that I could figure out just what I am supposed to do with git.  The entire thing is new to me.

So... I made a fork here: http://github.com/reakinator/pymt, cloned it to my hard drive and made a seperate branch called 'slider-color-down', then made some changes to this branch.  I then did a git commit, followed by a push with:

git push g...@github.com:reakinator/pymt.git

... but I don't see my new branch or the commits on github.  What did I miss?

cheers,
Rich

Christopher Denter

unread,
Aug 1, 2010, 11:07:53 AM8/1/10
to pymt...@googlegroups.com
Rich,

in your local repo's branch, try:
git push origin $branch

'origin' was automatically set by git when you cloned from your fork. It's your remote github *repo*.
'branch' is the branch you want to push to, i.e. slider-color-down.
So it becomes:
git push origin slider-color-down

In github, make sure to select the appropriate branch then. There's a button on the left that says "switch branches". Make sure you're on the right branch when sending the pull request.

HTH,
Christopher

> --
> You received this message because you are subscribed to the Google Groups "pymt-dev" group.
> To post to this group, send email to pymt...@googlegroups.com.
> To unsubscribe from this group, send email to pymt-dev+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pymt-dev?hl=en.

Rich E

unread,
Aug 1, 2010, 11:56:52 AM8/1/10
to pymt...@googlegroups.com
Ah, got it, thanks!

One more question, why do I have to do a 'git add' to the files I modified before doing 'git commit'?  It seems like what I was doing in svn (svn commit) has now turned into 3 commands... I know it is supposed to be easier to fix bad commits but this seems like too much.  Still figuring out the system though.

cheers,
Rich

Christopher Denter

unread,
Aug 1, 2010, 12:12:40 PM8/1/10
to pymt...@googlegroups.com
Rich,

read about git's so-called "index".

It's actually pretty nice. It allows you to change several files, without having to revert some of them to get a clean, atomic commit (cause that's how commits should be).
You can even only commit parts of one file if you want. That's really handy. Obviously you are right though that sometimes you'd want to just commit all you've done because it already is a nice, clean, atomic commit.
In that case, just don't use git add and use git commit -a instead. The -a flag tells it to automatically add all files that were modified. If you prefer specifying a commit message on the command line instead of in your editor, combine it with -m and you'll get: git commit -am "commit message goes here".

HTH,
Christopher

Rich E

unread,
Aug 1, 2010, 12:31:22 PM8/1/10
to pymt...@googlegroups.com
Great to know, the -am flag is what I needed.  Thanks Christopher!

Rich

Rich E

unread,
Aug 16, 2010, 2:56:26 AM8/16/10
to pymt...@googlegroups.com
Ok new question:  After I have a fork, have requested a merge and I then have my fork still sitting around, then what?  Is that fork done with, or do I merge the master back in?  I am not getting any commits from the master branch on my fork (I am sure it is perfectly normally, I am just not understanding the system yet).

I would hope to be able to keep all my branches at http://github.com/reakinator/pymt.git, if possible. But maybe I need to create a new fork for each branch I create?

rich

Mathieu Virbel

unread,
Aug 16, 2010, 3:35:44 AM8/16/10
to pymt...@googlegroups.com
You must add the the upstream as a remote branch, like :

git remote add tito git://github.com/tito/pymt.git

And then, you can merge upstream :

git pull tito master

And you'll update your branch with upstream revisions :)

Mathieu

2010/8/16 Rich E <reaki...@gmail.com>:

Rich E

unread,
Aug 17, 2010, 3:54:16 AM8/17/10
to pymt...@googlegroups.com
great, just what I was looking to do.  Thanks Mathieu!

Rich
Reply all
Reply to author
Forward
0 new messages