unloco
unloco

Reputation: 7320

Github: fork into new branch

I need to fork the branch from PrestaShop:develop into a different branch and not username:develop

How can this be done?

Upvotes: 1

Views: 878

Answers (1)

John_West
John_West

Reputation: 2399

Fork = clone repository of another user on Github, and make GitHub know about it

1) Fork the repo as usual with the fork button

2) If you want to rename the branch

git branch -m old_branch_name new_branch_name
git push origin :old_branch_name
git push origin new_branch_name

If you want to rename not branch but the whole repository - see, How.


If you want to have both branches in one repository, it is not a GitHub feature named fork, it is branching: branch ..., or checkout -b:

git checkout -b new_branch old_branch
git push -u origin new_branch

In that case you should not cope with GitHub forks to create a new branch from yours existing one.

Upvotes: 3

Related Questions