Good afternoon, now I work with a repository in which branches are organized into folders: features in the topic/myfeature folder, bugfixes/myfeature in the bugfixes/myfeature .

Actually the question is, can I configure the default name for all new branches I create using git itself or the sourcetree ? That is, I want that when I click "create a new branch" I was asked to automatically create a branch called topic/* .

That is, I need the preset name of the branch I am creating. The branch itself, the name of the repository has nothing to do with it.

  • one
    Added a git-flow tag to the question. In the description of the label you can find links to documentation and software. - Nick Volynkin pm

2 answers 2

What you are describing is a git-flow extension that introduces high-level operations to control the flow of development. Judging by the naming convention, most of the developers in your command use / use it.

SourceTree can work with this extension. Clicking on the "Git Flow" button on the toolbar opens the Git Flow initialization dialog:

git flow initialization dialog

In it, you can specify the names of branches for development and sale, for features, releases, hotfixes, and prefixes for version tags.

After initialization, clicking on the Git Flow button will display a dialog of operations, allowing you to start and finish work on features, releases, hotfixes, etc:

GitFLow operations dialog

  • Thank you, that's it) - Duck Learns to Take Cover
  • 2
    then so habrahabr.ru/post/106912 - username
  • @username, yeah, thanks, I read it before, but it didn't work for me in my work, so gitflow was postponed in my head as a way of organizing branching, and I don’t even think about using this tool - Duck Learning to Take Cover
 git remote -v # View existing remotes # origin https://github.com/OWNER/REPOSITORY.git (fetch) # origin https://github.com/OWNER/REPOSITORY.git (push) git remote rename origin topic # Change remote name from 'origin' to 'topic' git remote -v # Verify remote's new name # topic https://github.com/FORKER/REPOSITORY.git (fetch) # topic https://github.com/FORKER/REPOSITORY.git (push) 

local config is stored here, if that

 vim .git/config 
  • Perhaps I wrote incomprehensibly. I don't need to rename the remote repository. There are folders on the remote repository. Folders have names like topic / bugs / etc. I need to create a branch which will be called topic / mysuperbranch so that I immediately push it in topic / mysuperbrunch on the remote repository. If I do as you have written, then my task will not solve it at all =) - Duck Learns to Take Cover
  • open look config - username
  • but in general there is a git remote set-head topic mysuperbranch although I’m not sure what you need anymore - username
  • thanks, I've already answered, I needed gitflow) - Duck Learns to Take Cover