-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
- Loading branch information
There are no files selected for viewing
6 comments
on commit 5a163f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still wrong. The -b
option requires giving the name of the new branch so you are using the revision to name the branch which will then be based on the current state (so master)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stof. If i don't make the name with -b, the new branch named with the revision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git checkout -b <new_branch> <target_revision>
. In your case, you omit the target revision so it uses the current revision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That why I have changed the checkout line ; Because with just -b option you create locally branch named %s but you will work on master branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BorisMorel except that your own version was broken for tags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stof, Now Garfield-fr check if it's a tag or branch, so the modification is only available for branch.
I suggest
$gitcommand = sprintf('git checkout -b %s origin/%s', $repository->getRevision(), $repository->getRevision());