开发者

Git Branches without Pulling

开发者 https://www.devze.com 2023-03-25 03:19 出处:网络
I have 4 projects that are all related to a single software package. One of those 4 projects can be considered the \"pristine\" which gets a lot of attention and updates.

I have 4 projects that are all related to a single software package. One of those 4 projects can be considered the "pristine" which gets a lot of attention and updates.

I have this as the master branch.

What I want to do now, is to make the other 3 projects act as a branch, "mutation" branches, which share some structure but not all with the master branch.

How can I do this?

So far I've been trying to go to one of the project mutated directories and do the following:

git init
git remote add origin [...]
it checkout -b mutation1

But I get this weird message:

fatal: You a开发者_开发问答re on a branch yet to be born

I need to push without pulling the files from the master to the mutated projects.

Any tips?


When I understand you correctly, you have some code, and want to push this as a branch to an existing git repository?

As you cannot branch in an empty repository, first commit your code, and then create the branch:

git branch mutation1

Check it out and delete the master:

git checkout mutation1
git branch -d master

And then push it:

git push origin mutation1
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号