Problems Contributing and Sync'ing with git
-
I've had a great deal of difficulty coming up to speed with git and managing a repo at gitorious. I'm hoping that someone here might be able to help. No one at our facility has any experience with git. Last summer I created a clone for submitting some performance improvements to the 4.7 branch. I missed the deadline for API changes and need to see about getting some of these submitted properly for 4.8
Our clone has changes in a 4.5.3 branch and we'd like to apply these to the 4.7 branch. Before starting that work we knew the 4.7 branch in our local repo needed to be updated. But checking out the 4.7 branch and fetching does not update the local. It acts as if everything is up to date. 'git fetch' returns immediately.
In an act of desperation, I altered my .git/config file to something like this:
@
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/:refs/remotes/origin/
url = git://gitorious.org/~sbowline/qt/ilm-qt.git
[remote "official"] <-- HACK THIS IN
fetch = +refs/heads/:refs/remotes/origin/
url = git://gitorious.org/qt/qt.git
[branch "4.5"]
remote = origin
merge = refs/heads/4.5
[branch "4.7"]
remote = official <------ NOTE THIS
merge = refs/heads/4.7
@After that, lo and behold! It fetched all the proper labels and code. BUT...that can't be the right thing to do. For one thing, I cannot not 'git push' these changes back to my gitorious repo. It now thinks that is up-to-date and does nothing.
If anyone has any ideas I would love to hear them. Even better, if you know your git and would like to clone this repo and try it yourself:
@git://gitorious.org/~sbowline/qt/ilm-qt.git@
[Mark up code, Tobias]
-
It looks to be because your local clone was made from your own personal clone on gitorious not from the actual Qt repo. If you have not updated your personal clone on gitorious since you last pulled then of course there will be nothing to fetch.
What you have done by editing that file in this way is to tell git that you really did clone it from the official Qt repo on gitorious.
I usually just get my local repo by cloning the official Qt repo on gitorious and then explicitly tell git to push to my personal clone (or a team clone) on gitorious when I wish to publish my changes. The reason for this is that I do not see that gitorious provides any interface for directly pullling changes from the official Qt repo to a personal/team clone on gitorious.
So my data flow is:
@
Official Qt repo --> Local Qt clone ---> make local changes in branch --> Push to personal clone on gitorious --> Prepare Merge Request
@What you appear to be trying to do is:
@
Official Qt repo --> Personal clone on gitorious --> local clone --> make changes in branch --> Push to personal clone on gitorious --> Prepare Merge Request
@The problem is that the "pull" represented by the first arrow only happens once when you make the initial clone.