Reputation: 2017
Suppose this scene
.gitignore
file..gitignore
file, after building, i can't git fetch
or git pull
because git will promopts changes not committed
So i want to solve this, but i can't just make a .gitignore
with *.elf
because there are some elf files released with git server.
Of course i can't tell .gitignore
don't ignore these elf files released with git server because there may be some new elf binary files added to git server in the future
So, what if i create .gitignore
that ignore itself, so it won't be pushed to git server, but will it affect my git fetch
process? If there is two differenct .gitignore
rules in server and in my local computer, which one will git fetch
obey?
And how can i solve my problem?
Upvotes: 3
Views: 424
Reputation: 106508
First, stop storing binaries in your repository. Git is meant to track source code changes, not changes in binaries.
Second, there are actually three locations that are read for ignoring files to be tracked: .gitignore
(local project), .git/info/exclude
(local project, not public), and a global excludes file, which applies to all Git projects. Anything in your personal .git
folder is not shared upstream, so you can feel free to add whatever exclusions you like to that file so that they won't be propagated anywhere else.
It seems like you don't wish to create a .gitignore
file since you want to avoid the risk with removing the ELF files, but you're welcome to add that exclusion to your local .git/info/exclude
file.
Upvotes: 4