G
G
giggigi2012-03-19 14:19:43
git
giggigi, 2012-03-19 14:19:43

Ignoring files when pushing

Hello. There is a local repository and there is a bare repository on the server where changes are committed.
Through the update hook, the files are copied to the directory.

I read a bunch of information, but could not figure out how to solve my problem.
I have several files that need to be different locally and remotely.
If I locally check this file in .gitignore and do git rm --cached filename, then it is removed from the remote repository as well.

All I need is to have 2 different copies of the file on two machines so that I can change both files independently.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
leshka, 2012-03-19
@leshka

well, that's right. If you ignore it, it will be removed from your repository. And you can keep two different files instead of this file on different machines. Just put them in there and that's it.

H
hom9k, 2012-03-19
@hom9k

Put it outside of the repo and symlink when needed.

H
himik, 2012-03-19
@himik

git update-index --assume-unchanged path/to/file
and local files will not be committed, it seems they have not changed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question