Branches vs. New Project in Git
When setting up a dotfiles repo for several different platforms (eg. OS X, linux and Cygwin) would it be best to create branches for each machine type, or to use separate projects?
Many of the files will be the same, but some will have minor differences.
I tried creating branches off of my master, but pushing to the remote repo led to things like:
Your branch and 'master' have diverged,
and have 4 and 1 different commit(s) each, respectively.
I don't understand why my "Cygwin" branch is reporting its out of sync with master. It's a branch -- it's supposed to be different that the master.
Any suggestions of the best practice to accomplish my goal.
Thank You.
The diverged
message means that you have a tracked branch. You could disable tracking, see here how.
However, I don't think that the way you are using branches for multiplatform builds is correct. Better if you will have platform-dependent stuff separated by the code, eg by using conditional #include
s, #define
s or build scripts.
上一篇: 我如何“撤销”a
下一篇: 分支与Git中的新项目