0

I am trying to set automatic deployment for my project. The idea is to login with ssh and pulls in project dir in particular branch. But I want to exclude som directories from git pull. Because in some directory there are some daemon processes are running, which is highly sensitive.

I have already tried https://stackoverflow.com/a/4048993/2178763 and git sparse, but the first answer is not working, it is not checking out latest code after fetch -> checkout HEAD /path/

and for git-sparse, it is just removing all directories which are not available in the sparse-checkout file.

I am really stuck in here, Please help out here. I am sure this is duplicated question, but nothing is working for me.

rut2
  • 706
  • 1
  • 9
  • 29

1 Answers1

0

Git sparse does what you want. You should not try to checkout HEAD (!). HEAD always points to latest commit on your current branch, so you keep telling git to do nothing.

Patryk Obara
  • 1,847
  • 14
  • 19