Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] scm next steps

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: "Jeremy Blosser (emrys)" <jblosser-smgl AT firinn.org>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] scm next steps
  • Date: Sat, 29 Apr 2006 23:47:09 -0500

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.

Attachment: pgp9oPJk0hH4u.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page