It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I make new folder when I Create a branch in Sourcetree (git) from master ?

Jay Patel Dec 27, 2014

Hello,

 Is it possible ? To whenever create new branch from HEAD as a master automatically create new folder and pull into that branch. So I can easily switchover to master branch or new create branch.

 

In my case I create new branch and add some code and commit into new branch so in BitBucket show two branch with commit that are perfect. But in my local folder are only one. Now I my local folder show new branched code. so what about master branch.

How can I get master branch in new folder ? Same as when I create new branch automatically create new folder ? 

 

1 answer

0 votes

Git manages the branching. When you select a branch - the branch is the active branch and the local folder corresponds to the current branch. If you switch over the branch in source tree, the local folder will automatically reflect to selected branch. That is beauty of GIT.

To answer your question, can we do separate folder for each branch, yes clone the branch in different folder.

 

Jay Patel Dec 27, 2014

Thank you for your answer help me to know something new things. When I press click on checkout code update base on branch but when largest changes are present it take some time ? and is there any way to make new directory for different branch?

Seth Dec 29, 2014

The only way to have a two working copies (two different folders showing the contents of different branches) is to have two local repositories. That's what @Shomnathprabu Kasthuri meant when he said "Clone the branch in a different folder".

Balazs Szakmary Jan 02, 2015

If your repo is large and/or bandwidth to the server is low, consider creating the new clones by copying the first clone and checking out another branch in the copy. This can be much faster than cloning the same repo again from the server.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,652 views 1 18
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you