0

Initially I thought that a folder that shouldn't be tracked by git was included in my .gitignore file. However, for what ever the reason - it seems that this folder wasn't ignored.

Since then, I have made some changes and commits which have been pushed to my origin repo (including the folder I wish to have excluded). I recently 'untracked' the folder and pushed to the origin repo, which removed the folder altogether from the origin. This is fine but I'm now afraid that a push to my deploy server would delete this folder in the same way. How do I prevent this folder on my deploy server from being touched at all no matter of the commits made to it?

In a nutshell: - Origin repo is up-to date with latest commits. Has removed 'folder1' due to untracking 'folder1' on my local machine. - Deploy 'repo' is not yet up-to-date. Need 'folder1' to remain untouched after pushing.

Apologies if this has already been covered elsewhere, I couldn't find clarity on my exact scenario...

Magnus Bäck
  • 11,381
  • 3
  • 47
  • 59
user3197788
  • 165
  • 4
  • 14

1 Answers1

0

You need to "reset" your git, so the .gitignore works well. Follow the first answer this stackoverflow post in order to make your .gitignore working.

Just don't forget to restore your "floder1" on your remote before, then .gitignore should do the trick.

Community
  • 1
  • 1
Caillou
  • 1,451
  • 10
  • 19