[SM-Discuss] scm next steps
Jeremy Blosser (emrys)
jblosser-smgl at firinn.org
Sun Apr 30 00:47:09 EDT 2006
On Apr 27, Jeremy Blosser (emrys) [jblosser-smgl at firinn.org] wrote:
> Keep the above updated periodically:
> $ pushd /var/lib/sorcery/codex/devel.git; git pull; popd
> $ pushd /var/lib/sorcery/codex/test.git; git pull; popd
> - This updates those clones and their working copies to the latest state of
> the local repository they were cloned from.
I just found out the hard way that 'git pull' is not really the right
command to just update to the latest upstream changes.
The deal is that you have two things on disk, a repository (the .git/ dir)
and a working copy (the files you have available to edit). You switch the
working copy among the branches available in the repository using
'git checkout <branch>'. 'git pull' both syncs your repository AND updates
your working copy. This sounds like what you want, except that 'git pull'
without args does everything against the current working copy, meaning if
there are changes in stable when you update, but your working copy is test,
bad things will happen to your working copy.
The solution to this is to be be specific when you pull. Since most of you
will only be working in test, you want to do your sync from inside a
checked out 'master' branch with:
git pull . origin
(remember, 'origin' is the upstream version of the 'master' aka 'test'
branch). This will grab the updates against test and apply them to your
checked-out copy of test.
If you do happen to work in devel or stable*, depending on how you choose
to set up your local branches for those you'll have different pull commands
to use. Let me know if you need help figuring it out.
Note also that 'git fetch' will update all your repository branches that
are based on upstream (in the default set this is origin, devel, stable*,
but not master). It will not do anything to your working copy, though.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 232 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/sm-discuss/attachments/20060429/373d9654/attachment.bin
More information about the SM-Discuss