Skip to content

Instantly share code, notes, and snippets.

@573
Created March 12, 2024 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 573/dc441f801016123f38cf0d82512888f8 to your computer and use it in GitHub Desktop.
Save 573/dc441f801016123f38cf0d82512888f8 to your computer and use it in GitHub Desktop.
git tip: have a git repository separate from work tree to sync the former via syncthing and the latter via dropbox

https://medium.com/@tvii/separate-git-dir-8426ff0537a6
https://stackoverflow.com/a/58259804

mkdir ~/the-separate-git-dir # local only synched via syncthing
mkdir ~/the-content-dir # synched via dropbox
cd ~/the-content-dir/
git init --separate-git-dir=../the-separate-git-dir
touch Readme.md
echo This is a work tree with just a .git file referring to the folder containing the .git repository folder > Readme.md
git add .
git commit -m 'add Readme.md'

for more see stackoverflow link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment