Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks to all for the input and suggestions. Here's how I got my developers and integrators to use bare <code>git push</code> and <code>git pull</code>:</p> <h2>For The Developer</h2> <p>In the simplest integration-manager workflow, as described above, the developer has cloned (<code>git clone</code>) and is therefore automatically tracking the remote master branch in her local master branch, so all she needs is:</p> <pre><code>git pull </code></pre> <p>To update her local master branch. If she is working in some other branch, then she can update the upstream branch that is is tracking, as Adam suggested:</p> <pre><code>git branch --set-upstream MYOLDBRANCH origin/master # or, use longer, more explicit syntax, like: git branch --set-upstream MYOLDBRANCH refs/remotes/origin/master </code></pre> <p>The tracked branch (origin/master, in this case) will be pulled by default.</p> <p>Since the default push target is a different branch and not the same name, we cannot take advantage of the push.default being: tracking, current, or matching. Instead, our developer must set the default source:destination refspec for all pushes to a given remote in her .git/config file, like so:</p> <pre><code>[remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = GITREPOHOSTNAME:REPONAME push = master:refs/personal/MYDEVNAME/MYBRANCHNAME </code></pre> <p>She could also create an alias, like so:</p> <pre><code>git config alias.pushToMyBr 'push origin master:refs/personal/MYDEVNAME/MYBRANCHNAME </code></pre> <p>Aliases are very powerful and offer the ultimate flexibility in avoiding keystrokes. :-) The above case can be executed with a simple:</p> <pre><code>git pushToMyBr </code></pre> <h2>For The Integrator</h2> <p>In this simple case, the integrator usually pushes to one place, origin/master. If the push.default is set to matching, tracking, or current, then a bare push will work, like so:</p> <pre><code>git config push.default current git checkout master git push </code></pre> <p>The frequent pull from various personal developer branches is the more difficult case. The integrator can use aliases to simplify the task, like so:</p> <pre><code>git config alias.pullFromXY 'pull origin refs/personal/DEVNAMEX/BRANCHNAMEY:master # or, pull to a specific topic branch git config alias.pullFromABtoC 'pull origin refs/personal/DEVNAMEA/BRANCHNAMEB:branchC' </code></pre> <p>The integrator can also create branches to track the developer's personal remote branches, like so:</p> <pre><code>git checkout -b test_devXbranchY origin/personal/DEVNAMEX/BRANCHNAMEY # or, use a more specific syntax: git checkout -b test_devXbranchY refs/remotes/origin/personal/DEVNAMEX/BRANCHNAMEY </code></pre> <p>For this to work, the integrator must add personal branches to her fetch list. This can be accomplished by directly editing her .git/config, like so: (I don't know how to do this with a git-config or any other git command.)</p> <pre><code>[remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = MYGITHOSTNAME:MYREPONAME fetch = +refs/personal/*:refs/remotes/origin/personal/* # Fetch a specific developer's branches: fetch = +refs/personal/devX/*:refs/remotes/origin/personal/devX/* </code></pre> <p>Thanks to all for the help! Hope this helps someone else who uses gitolite and personal branches outside of head-space.</p> <p>Thanks!</p> <p>Trevor</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload