Sunday, 15 September 2013

sync between git repo and non-git directory -



sync between git repo and non-git directory -

i find efficient way of syncing files between git repo , target directory. target directory in case build location embedded linux distribution managed ptxdist.

i building various versions of distro set various git repos corresponding commit, rsync build tree, , build distro. problem approach rsync leaves files 1 commit may not exist in commit , cause confusion code.

i create distro git repository , git pull don't need track happen building.

the best candidate seems using git-archive create tar files of git repos, delete target directories, extract tar files target directories. however, seems inefficient if few files have changed out of goes distro.

what way rsync --delete, or perhaps unison -prefer, files in git repository instead of git working directory since have untracked files want maintain around.

if "could create distro git repository , git pull into", means:

git (or can be) available on server the server can contact client (while reverse isn't obvious)

you could:

make bare repo on server /path/to/myrepo.git set in post-update hook: /path/to/myrepo.git/hooks/post-update git pull

the post-update script can, after each pull, trigger a:

git --work-tree=/path/to/target/directory --git-dir=/path/to/myrepo.git checkout head

that ignore untracked files, update (add/modify/remove) tracked file after each git pull.

git

No comments:

Post a Comment