I'm managing a project using stash and git. Recently I've seen a new solution for some part of my project. Now I want to apply it as test without affecting my master code and if it would be good enough I add it later to master. So the problem is Should I make a fork from my project or I have to create new Repository? or Any better solution.
-
Do both! Making a new repository is about as painful as making a copy of a file. Clone the repo, create a branch, have a working directory available for each. – William Pursell Feb 13 '16 at 10:04
4 Answers
The solution of your problem is a branch. It is the reason they exists, to allow the development of a feature in an isolated context, without affecting the master.
Read more about branching and merging.

- 68,258
- 9
- 99
- 134
Since a BitBucket server has branch permission, you could simply create a branch in the same repo.
But if your new solution involve a large refactoring, and adding that branch to the main repo would bring noise (because it is not related to the main development branches), you can make a fork, in which you can push as many branch as you want without polluting the branch namespace of the main repo.
For an experiment unrelated with the development tasks at hand, I would go with a fork.

- 1,262,500
- 529
- 4,410
- 5,250
-
My new feature cause lots of files to be removed and some codes be added. But I'm afraid of fork syncing feature and worry about unintended fault in master repos – JGC Feb 13 '16 at 08:44
-
The best way is to branch from master and do the changes in this new branch. This branch can be merged in the master anytime as per needs.

- 2,548
- 2
- 26
- 48
If it is just for a test I suggest a branch. A fork is usually more suitable when you are collaborating among different teams in a company or if open source then to make your changes and submit a pull request.
Just don't merge the test without making sure it works as needed.

- 1,933
- 3
- 20
- 35