Git makes my head hurt...

So I cloned the Qt master repository on Gitorious as odysseus-clone a few months back, and then cloned odysseus-clone onto my laptop where I've been working away happily.  Now I want to make sure my work is still OK against the latest master before doing a merge request, so I think I need to update my odysseus-clone on gitorious first to the latest master, then do a fetch/rebase to update my local clone, then push my changes up to Gitorious. 

Thing is, I can't for the life of me figure out how to get my odysseus-clone on Gitorious to update to the current master.  Any clues?  Or have I got this all wrong?  1am is not the best time to be trying to figure this out :-)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

A good guide is

A good guide is http://qt.gitorious.org/qt/pages/GitIntroductionWithQt

I had no clue about git, but was able to make two merge requests just following this guide*. If you have questions, you can also ask on IRC, people there are really helpful

Happy coding :)

*okay, I needed some help, too :)

I don't see any reason why

I don't see any reason why you would need to update your repository on gitorious from master first.
Pulling stuff into your private repository and pushing all the changes upstream should work just as well in my opinion.
just to be safe make a clone of your gitorious repo in a new dir and do a git diff on your tree, patch the other tree with it
than pull in the copy the stuff from the other master (it's simply git pull proto://host...) and try pushing from there
Best of luck

You could try....

I'd say make a clone of your local copy you've been working on (if you want to be safe, or you could create a branch or two which should work too IIRC) then you can do a direct fetch/rebase (or pull --rebase) from the qt master that you made the original clone. If it rebases cleanly, you can push directly to your original clone, then submit the merge request (at least that's how it can work, I've never really done this myself since I'm typically the only one working on my git repos :P)

This is how I do it:

1. clone repo
2. create a new branch for me to write stuff into
3. pull to update the master branch
4. `git rebase master` while I'm in my branch to make all the changes look like they were made against the latest master(and sort out conflicts)
4. after rebase is complete(it can take a while to sort out all the conflicts) you can happily push the changes upstream(or even create patches, they'll apply cleanly as well)
Of course if you didn't create a new branch and happily hacked away on the master you can create a new branch that points to origin:HEAD and use that for your pull/rebase

When working against Qt, I

When working against Qt, I usually have two git remotes in my local repository: my gitorious clone of Qt (for pushing my branches to - let's call it "myclone" here), and the master repository of Qt (called "upstream", so I have remote branches like upstream/master and upstream/4.5 etc). Then when my work branch e.g. "fix-bug-123456" is ready for a merge request, I rebase it onto "upstream/4.5" or "upstream/master" and once that is done cleanly, I push "fix-bug-123456" to "myclone".
Hope this helps

Git workflow

You can think about it this way: your *real* repository is on your computer. That's where all the work goes on; that where all the merging takes place, everything. That's the big difference between DVCS and Wiki-like systems (e.g. SVN). Gitorious is simply a method of making your work public.

If you need to merge upstream changes, you should fetch that branch into your local repository (the "real" one), merge them, and then make changes public by pushing to your Gitorious repo. Normally, nothing should be done directly to your public repo on Gitorious; it's just a mirror of your local repository. You should never need to pull from your Gitorious repository.

In brief: pull from other people, merge, and push to your public repo.

Thanks guys.

Thanks for the pointers, that makes a lot more sense after a nights sleep and plenty of coffee, and finding this page http://devwiki.pfsense.org/GitWorkflow which helps explain it too.
For the record I decided to start cleanly from scratch, clone my local repo directly from the mainline qt rather than my Gitorious clone, add my Gitorious clone as an extra remote, branch from the origin, then pull from origin and push to my clone. Seems a cleaner way than what I had.
git clone git://gitorious.org/qt/qt.git
cd qt
git branch advanced-page-selection origin/4.6
// do stuff and commit
git remote add odysseus-clone git@gitorious.org:~odysseus/qt/odysseus-clone.git
git push odysseus-clone advanced-page-selection

Thanks, your website is very

Thanks, your website is very helpful

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.