For a university project, we are using a git repository that was set up by the chair giving the lecture. Once a day their server pulls the latest version of our project and runs secret evaluation tests. Therefore we need to guarantee that the files in our repo can be compiled by the server.
Since we used flex to generate code for one of the tasks we had to accomplish, we need to guarantee that the file was generated by the correct flex-version. (Otherwise, the server can't compile the generated file.)
But my system doesn't support the flex-version of their server. So I do need to generate another version of the file to compile everything on my system. When I'm finished with coding my usual routine at the moment is:
git add --all
git reset generated-file1.c
git reset generated-file2.c
... (commit and push)
Since this was getting on my nerves I've already created a custom command that does this for me. However, I wanted to ask if there is something similar to a .gitignore
to "lock" a specific version (that will compile on the server) of our generated files. So anyone on our team will only need to use git add -all
in order to add everything except the generated files.
Edit: Thanks to phd's suggestion here I came a little bit closer to what I want. What's still missing for me is the part:
... anyone on our team will only need to to use
git add -all
...
By using git update-index --skip-worktree generated-file*.c
I will only fix this for my system. What I was looking for is a one time change in our repo that affects all systems. (The other members have the same problem as well.)
I know that they could copy and paste the same thing into their terminal, but I wanted to know if there is a more elegant way to do this (similar to the .gitignore
), where I can list the files and they will be ignored on every system.
Cheers,
Pascal