callahanp (10) [Avatar] Offline
#1
In section 2.1.3, you state:

"When the fetch and push URLs differ?
These will not differ unless they have been set to do so by the git remote command or by Git configuration. ItÂ’s almost never necessary to do this so I will not cover it in this book."

Some questions then:

I have read access to the main git repositories on gitorious, but do not have commit privileges. There's two options for me when submitting changes: e-mail a patch or complete file to someone with commit privs, or create a gitorious clone, push the change to the gitorious clone and request a merge.

I'd prefer to use the personal gitorious clone so changes are public and reviewable in context without commiting them to the project. I commit the changes on a feature branch on the personal clone.

Meanwhile the main project moves on and others commit on the main repository. I need to keep my personal clone in sync with others work, so I need to pull from the main repository while pushing to my clone.

Isn't that the "almost never necessary" case for different fetch and push urls? Or am I missing something? Is there a better way to participate in development when you don't have or expect to have commit rights?

-Pat Callahan
Mike McQuaid (83) [Avatar] Offline
#2
Re: When the fetch and push URLs differ?
In this case you'd typically add the main repository and your clone as different remotes.
scpeters (4) [Avatar] Offline
#3
Re: When the fetch and push URLs differ?
I use different fetch and push URL's sometimes. When I ssh to my Ubuntu desktop machine, it locks my certificates, so I would have to type my passphrase to unlock them. When I'm using it directly, the certificates are unlocked. So using the https URL's for fetch allows me to fetch without typing my ssh certificate pass phrase.

It's kind of an edge case, but I actually find it useful sometimes.
Mike McQuaid (83) [Avatar] Offline
#4
Re: When the fetch and push URLs differ?
Oh, it's definitely useful but, as you've said, it's a bit of an edge case so I won't be covering it in Chapter 2. Thanks for the input though!