You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The remote I push to has restrictions on the format of the branch name. When you forget this you get kind of stuck, see example below.
This could be avoided by applying the same branch name rules locally through git-town.
I'm happy to implement this myself, but I'd need some guidance.
my-repo/ on master
› git-town hack example
[master] git fetch --prune --tags
From gitlab.com:my-org/my-repo
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (1/1), 259 bytes | 259.00 KiB/s, done.
2e973e9d7..11cf748e9 master -> origin/master
[master] git rebase origin/master
Successfully rebased and updated refs/heads/master.
[master] git branch example master
[master] git checkout example
Switched to branch 'example'
my-repo/ on example
› git-town sync
[example] git fetch --prune --tags
[example] git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
[master] git rebase origin/master
Current branch master is up to date.
[master] git checkout example
Switched to branch 'example'
[example] git merge --no-edit master
Already up to date.
[example] git push -u origin example
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: GitLab: Branch name 'example' does not follow the pattern '^(ftr|enh|fix)-\w[\w-]+\w$'
To gitlab.com:my-org/my-repo
! [remote rejected] example -> example (pre-receive hook declined)
error: failed to push some refs to 'gitlab.com:my-org/my-repo'
Error: exit status 1
To abort, run "git-town abort".
To continue after having resolved conflicts, run "git-town continue".
To continue by skipping the current branch, run "git-town skip".
my-repo/ on example
› git-town rename-branch fix-example
? You have an unfinished `sync` command that ended on the `example` branch 12 seconds ago. Please choose how to proceed Abort the `sync` command
my-repo/ on example
› git-town rename-branch fix-example
[example] git fetch --prune --tags
Error: "example" is not in sync with its tracking branch, please sync the branches before renaming
my-repo/ on example
›
The text was updated successfully, but these errors were encountered:
Interesting edge case, thanks for reporting it. Technically your example branch shouldn't have a tracking branch since the remote rejected the push. Git Town saying that the branch is not in sync with its tracking branch is a bug in Git Town. I have just fixed this bug in #2710. I hope this solves the issue you report.
The remote I push to has restrictions on the format of the branch name. When you forget this you get kind of stuck, see example below.
This could be avoided by applying the same branch name rules locally through git-town.
I'm happy to implement this myself, but I'd need some guidance.
The text was updated successfully, but these errors were encountered: