Krowar
Krowar

Reputation: 591

How to create a basic project that everyone can pull, but not push

In my firm we are currently building a basic VS project which will be the beginning of every new project. In this project, we'll add the "good" version of the dependencies such as jquery or bootstrap.

For the moment, it is just a folder that people manually copies and start the project from it.

Would it be possible for the developpers to pull the project, and then consider it as a new git project? So that when they commit new versions, it is no more considered as new versions of the "base project"?

Thanks a lot

Upvotes: 1

Views: 60

Answers (2)

jthill
jthill

Reputation: 60275

It sounds like what you really want is a repository template.

To use a template just this time:

git init --template=/path/to/template

To use a template by default at whatever level you want:

git config {--global,--system} init.templatedir /path/to/template

git init --template='' x makes a no-frills-at-all repo in x. Your template can contain anything.

Upvotes: 1

AbstractProblemFactory
AbstractProblemFactory

Reputation: 9811

Assuming nobody will change initial set of files, git pull origin should work straight forward.

To push it to different location than original, just add it as another remote location, like git remote add origin2 https://github.com/user/repo.git, and to block pushing to "base project", remember to remove all redundant public keys from ~/.ssh/authorized_keys.

Upvotes: 1

Related Questions