deployment - Is it possible to stop tracking files in the git repo, but have them remain in all remote checkouts? -


i accidentally added third-party library repo , pushed changes live server, bare repo post-receive hook checks out master branch webroot.

i'd stop tracking files in local repo, add them .gitignore , push changes live server, without deleting files live server. still need library on live server, not managed version control. i'd able make changes library on live server (all best practices aside) without being overwritten version git repo on every push.

is possible? i've tried other repos , it's deleted.

the .gitignore file ignore file - won't tracked, , wont part of repository. can ignore changes tracked file using git-update-index --assume-unchanged flag.

git update-index --assume-unchanged <path> 

the --assume-unchanged parameter allows make changes locally without having check them in or push them up. not keep file being overwritten checkout. prevent that, should instead use following flag.

git update-index --skip-worktree <path> 

either of these affect local repository. fact assuming path remain unchanged, or should skipped can not pushed remote - think of local config.

however, these sorts of thing, the real answer stop using git deployment tool. there plenty of tools out there can handle deployments less hassle git. (capistrano, phing, ant, etc...)


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -