4

I 'm working on a sandbox module, which is text_or_user_reference field.

To release the module, I have to create a branch of the module i.e 7.x-1.0

Since beginning of the module development I was not aware with this thing, so I was working on master branch.

Now I have to add the tags to create the branch. To create the tags I followed this guide on drupal.org

These are the commands to push and create the tags:

git tag 7.x-1.0

git push --tags

git push origin tag 7.x-1.0

I have applied all the commands, but I am not able to see whether tags are created or not.

My problems:

  • How to check whether tags are created or not ?

  • Do I have to seperately assign to tags to each file like .module file, .install file etc.

  • When I go to Edit of the project and select the dropdown version to work from it doesn't show the tags/version I created i.e. 7.x-1.0

    Consider this command:

    git branch -v

    What should I expect as a result after I run it? The list of all the files of current branch?

1 Answer 1

3

In git, the terms "branch" and "tag" always applies to the whole repository, not to the individual files. A branch denote is a series of commits (so you always use an "x" instead of specific version number for a branch). A tag is a label for a specific version, so you specify the version number (e.g. 1.0 for the first released version, 1.1 for the next, and so on.)

The command git branch -v will give a verbose listing of the current head. It should, in the case of Drupal 7, start with a line * 7.x-1.x. If it says master on the first line, you've not set things up right.

Before adding tags, you need to get your project on a 7.x-1.x branch. In your local repository, do the following to checkout branch 7.x-1.x and delete branch master, and push those changes to the remote:

git checkout -b 7.x-1.x
git branch -d master
git branch -v
git push origin 7.x-1.x
git push origin :master

After you've made sure the branch is 7.x-1.x, you can go ahead and add a tag to your release.

You can use the commands you refer to, to tag. To see all the tag(s) in the local repository:

git tag

After pushing to the remote, if you've done this correctly, you should be able to click on the Version control tab and find the 7.x-1-x branch in the Version to work from: pull-down menu. If you retain the master branch, make sure that you make the 7.x-1.x branch the default.

5
  • Do i have to assign tags to each file manually? as i can find that only one file has tags added and this file is README.txt file Commented May 1, 2013 at 7:18
  • Shall i give the name like 7.x-1.0 or 7.x-1.X Commented May 1, 2013 at 7:21
  • So first i have to create a branch right ? Commented May 1, 2013 at 7:25
  • last question..do i have to delete the master branch? because it is better if we keep it Commented May 1, 2013 at 7:32
  • No - but the master branch is confusing in the context of a Drupal release, since ir may apply to any version of Drupal. Commented May 1, 2013 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.