Reputation: 988
I have repository ABC with branches master, test and development.
master directory structure has:
test branch has similar structure:
development branch has similar structure:
All branches have exactly the same content inside the folders. Commits and changes go to development first and then merge into test then into master. Question is how do I do these merges between branches with the difference in the folder name structure?
Upvotes: 1
Views: 1410
Reputation: 165586
Question is how do I do these merges between branches with the difference in the folder name structure?
You rename the directories to match, commit, and then merge.
This is not a viable workflow, and it's not an efficient use of branches.
Since the branches already keep your dev, test, and presumably production versions separate, there's no need to change the directory names. Name the same things the same in all branches and the problem goes away.
As for the onlytestfile.txt
, and onlydevfile.txt
you can't exclude files from a merge. You have to merge everything. So you either have to delete it and commit before merging, or git merge --no-commit
and manually delete the file yourself (which someone will inevitably forget to do), or come up with a better strategy. I suggest the last one.
I presume this is configuration information. There are various better strategies for storing the config for multiple environments, and I lay one out in this answer.
Upvotes: 1