git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git default behavior seems odd from a Unix command line point of view

From
Andrew Schein <andrew@andrewschein.com>
Date
May 12, 2009, 20:05 UTC
Message-ID
<4e963a650905121305s244309a5vef9eec671d1ee5e@mail.gmail.com>
In-Reply-To
<alpine.LNX.2.00.0905121415000.2147@iabervon.org>
> What *is* your use case? What you're doing seems nuts to me (like, you're
> going to send out files with this script that someone is in the middle of
> editting), but I don't know what you're trying to do.

I am new to git... so my first instinct is to try to reproduce a work flow that I know works with mercurial setup. It is possible that the concepts don't translate correctly. Here goes...

I have a bunch of separate project-related repositories. There are very few users of the system. Most of the time I am the only user. I want a system for syncing my local repositories to a single shared repository. For example some days I work on my laptop, and some days from my desktop. A third "shared/public" repository "on campus" serves as an always available repository that anyone I collaborate with can pull from. Also it is backed up, and for this reason I designate it the "shared" version. So the purpose of the sync.sh script is to synchronize the personal laptop/desktop repository to the on-campus version.

Something I have learned from using mercurial in industry is that when somebody messes up a "public repo" with conflicts they frequently don't clean up the mess. This can be a sign that they have not learned the lessons of cleanliness rather than ill intent. Otherwise (and similarly) this messiness can be caused from not noticing that they have left a mess.

The motivation of having a sync script that is run on each user's local repository is to decrease the likelihood of a mess. This is achieved by first pulling from the common repository and resolving conflicts _before_ "pushing" (note quotations) their changes to the common repository. There is a possibility of a race condition that leaves a conflict on the shared repository, however the risk is diminished.

Finally, I use "push" in quotes because actually the script uses only uses the pull command. This prevents proliferation of branches on the shared repository.

Is there a better way to achieve this in git than the sync.sh script I sent around?

Thanks,
Andy
-- 
Andrew I. Schein
www.andrewschein.com
Previous: Daniel BarkalowNext: Daniel Barkalow
Message 6 of 8 in “git default behavior seems odd from a Unix command line point of view”
  1. Andrew ScheinMay 12, 2009
  2. Junio C HamanoMay 12, 2009
  3. Andrew ScheinMay 12, 2009
  4. Jeff KingMay 12, 2009
  5. Daniel BarkalowMay 12, 2009
  6. Andrew ScheinMay 12, 2009
  7. Daniel BarkalowMay 12, 2009
  8. Jeff KingMay 12, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.