Working on a branch or creating a fork?

ThePokyWizard September 5, 2022

Months ago I started a branch in a project, it happens that the branch has not yet been merged into master, however, over the months there have been major changes in master.

Now this branch should be closed, but it shouldn't go to master yet. And a new branch with new features will be created, based on the latest master updates.

The problem is that even these last two branches are closed they cannot be merged with the master, which will continue to receive updates for a period, until a specific date.
It will be at that moment that it will be able to receive the resources of the two branches.

My question is: should I fork the original project, to get the updates that master will receive, and make changes to the branches, or should I continue working on a branch?

1 answer

1 accepted

0 votes
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 6, 2022

Hello @ThePokyWizard ,

Thank you for reaching out to Atlassian Community!

Both options - continue working on a branch or creating a fork - would work in this case, and in the end, it's up to which of them you prefer.

Forking a repository is usually used when you want to make experiments in a repository but don't want to mess with the main repo. It's also applicable when you want to contribute to a repository where you do not have permission to push, so you fork the repository, make your changes, and then create a Pull Request to merge the changes back in the main repo. These changes would then be reviewed by a user from the main repo that has permission to write to it.

In either of the options, you would end up having to merge the changes between the master and the feature branch through a Pull Request and resolving any conflict in the files that might have been created when both the feature and master branches were being worked on. 

Besides these options, another alternative would be for you to synch the feature branches with the latest changes from the master branch by merging them :

git checkout feature_branch 
git merge main_branch

This would merge the changes from the main_branch to the feature_branch (you might need to resolve the conflicts) and you would be able to continue working in the feature branch with the latest code from the main_branch.

For more information on merging and rebasing to synch the branches see our Merging vs Rebasing 

Hope that helps! Let me know in case you have any questions.

Thank you, @ThePokyWizard .

Kind regards,

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events