Project

General

Profile

Git repository: Set a branch as default for redmine

Added by Nabil Kadimi almost 14 years ago

Hello,

I'm new to Redmine and Git, so I don't know if it's me or Redmine or Git.

I installed redmine and set up git and imported into it a project that needed more work, I renamed the "master" branch as "1.0.0" and then added another branch "1.0.1".

As you can see, git recognises 1.0.1as the current working branch:
me@srv [~/rep/project]# git branch
1.0.0
  • 1.0.1

But when i visit http://www.example.com/projects/project/repository Redmine always chooses to show me the branch 1.0.0

Is this normal?
How can I tell redmine to show me 1.0.1 instead of 1.0.0

Kind Regards,
Nabil Kadimi (coming from PHP).


Replies (4)

RE: Git repository: Set a branch as default for redmine - Added by Felix Schäfer almost 14 years ago

There is no such thing as a "default branch" on git, git branch only shows you the one you are working on which is a local setting, not one that others copies of that repository will have. The consensus seems to be to have a "master" branch, which redmine seems to follow too. See source:trunk/lib/redmine/scm/adapters/git_adapter.rb#L55 for the implementation.

RE: Git repository: Set a branch as default for redmine - Added by Nabil Kadimi almost 14 years ago

I see, thanks for the hints.
I renamed 1.0.1 to master.. I don't know if it's a good practice but at least it helps me see the latest (the working) branch

RE: Git repository: Set a branch as default for redmine - Added by Felix Schäfer almost 14 years ago

From what I'm reading, I'm not sure branches are what you are looking for… If you just want to flag a certain commit as being the point in the git history at which you shipped 1.0.0, you should rather use a tag. Google should point you to more complete sources, though http://ricroberts.com/articles/getting-to-grips-with-git-part-2-branches-and-tags seems to sum it up nicely.

RE: Git repository: Set a branch as default for redmine - Added by Zoee Silcock over 11 years ago

If you have access to the bare repository you can use symbolic-ref to set the default HEAD branch. Navigate into your bare repository and type in the following:

git symbolic-ref HEAD refs/heads/mybranch

From now on redmine will default to the "mybranch" branch when visiting the Repository tab.

Source: http://stackoverflow.com/a/3302018/309160

    (1-4/4)