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

Syncing Git Repositories

From
SPSajan Parikh <sajan@parikh.io>
Date
Jul 17, 2014, 02:26 UTC
Message-ID
<53C7343F.4090806@parikh.io>

On all my laptops and desktops, I have a directory at /home/sajan/Code where all my active projects and repositories live.

/home/sajan/Code/repository1 /home/sajan/Code/repository2 /home/sajan/Code/repository3

...etc...

Up until now I've relied on pushing and pulling to and from my Gitlab server to keep my projects in sync across all my laptops and desktops. It's worked great.

However, today I decided to add my code folder to my ownCloud server and sync it across all my laptops and desktops the same way I do for /home/sajan/Documents, /home/sajan/Music, and a few application config directories to keep all my devices in sync.

By syncing my code folder and git repositories in this way, do I risk borking any repositories? I'm 99% confident I'm not, since everything is in .git/, and there are not external databases or log files that need to be updated. Just making sure though.

I'm only doing this because sometimes I forget to pull changes down from my Gitlab server on a different laptop or desktop and start making local changes. Which is fine, I can merge easily, but if everything were sync'd automatically when I logged into my computer it would be great.

Another option I thought of would be to write a bash script that executed at login and went into each of my repositories and ran git pull, but I decided against this because of legitimate non-fast-forward merges.

TLDR;

If I sync my repositories across computers using something similar to Dropbox, rather than pushing/pulling to and from an central repository, am I risking borking any respository?

-- 
Sajan Parikh
Next: Matthieu Moy
Message 1 of 3 in “Syncing Git Repositories”
  1. Sajan ParikhJul 17, 2014
  2. Matthieu MoyJul 17, 2014
  3. Junio C HamanoJul 17, 2014

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.