kreek
kreek

Reputation: 8834

git: exclude files from remote

I have a Play Scala app which has two remotes, one for source, and another for deployment. Deployment needs the ./target directory but I want to keep the source remote clean of build files. Is it possible to have only the source remote ignore the target directory?

thanks!

Upvotes: 1

Views: 520

Answers (2)

Samy Dindane
Samy Dindane

Reputation: 18716

What about having a deploy branch, whose upstream would be your remote deployment branch, and where you don't ignore the build/ directory?
You would then have to merge your development branch into deploy before each deployement.

Upvotes: 1

Steinar
Steinar

Reputation: 5950

Add a .gitignore file to your repository (root), e.g. something like the following:

# Ignore target directory
target

Edit: Sorry, too fast on the trigger there. This will ignore the target file for both remotes. To include some files in your deployment remote, you should probably use different branches.

One branch for your deployment and one for your source. Whenever you deploy, merge differences from source branch to deployment branch. In the deployment branch, your .gitignore file could look differently.

Upvotes: 3

Related Questions