oz1cz
oz1cz

Reputation: 5824

Windows and Mac project under Git

I'm trying to set up a software project under Git. The project will be compiled both on Mac and Windows computers. The vast majority of the files are the same in both the Mac and Windows versions, but there are a few cases where I want the following:

File xxx exists in a Mac and a Windows version. I want both versions stored in the Git repository, but on the Mac computer I want to access and modify only the Mac version, and on the Windows computer I want to access and modify only the Windows version.

File yyy exists in the Mac version but is absent in the Windows version. When I use a Mac computer to pull the project from the Git server, I want the file yyy included; but when I use a Windows computer to pull the project from the Git server, I don't want the yyy file.

What is the best approach to this?

Upvotes: 0

Views: 171

Answers (3)

prusswan
prusswan

Reputation: 7101

Depending on the composition and size of the files, you can either:

  1. organize them by environment and update your compilation procedure to account for multiple environments. This is the common approach and I never had a problem with this approach for the stacks I have worked on (java, rails)
  2. relocate them into separate repositories (submodules)

Upvotes: 1

Lazy Badger
Lazy Badger

Reputation: 97282

Two branches (mergeable), two (different) remotes for clients?

Upvotes: 0

Adam Dymitruk
Adam Dymitruk

Reputation: 129564

Scripting may be your best choice.

Upvotes: 0

Related Questions