Reputation: 12383
I know that .gitignore
is used for ignoring files in push and pulls. But what I am trying to do is have like an add-on section, lets called it extra.
The flow works like this
The developer pulls the application
The extras section is automatically added to the gitignore
Another developer modifies the application by adding in "plug-ings" to the extras section
The developer pulls the application to keep it up-to-date but the extras section is never modified
My question is it possible to pull from git and already have a file or folder automatically be ignored?
Upvotes: 1
Views: 744
Reputation: 12946
Add extra
to .gitignore
and add .gitignore
to the repository.
So, when someone pull the repo, he will automatically get .gitignore
and the extra
directory is automatically ignored.
Upvotes: 3
Reputation: 1866
Simple example you have repository with 2 folders and 1 .ignore file
2 Folders
application and extras and
1 File
.gitignore
The .gitignore should have this in it
extras/
So whenever some body clones this repository they will get an extras folder where they can do what they want as it is ignored.
But if a developer makea a commit with content in the extras folder then developers that pulls from the repo, will get that content into the extras folder
Cheers
Upvotes: 0