[go: up one dir, main page]

Skip to content

Unable to add a file to an existing branch without changing the default project branch

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

When using the GitLab UI to add a file to an existing branch which is not the default branch, the user gets an error requesting the default branch be changed in the project settings. This change has a broader impact (Slack). The user should be able to set the branch in the UI to an existing branch without changing the default branch in the project.

Steps to reproduce

  1. Create a new branch (e.g. jocelynjane-testing-ui).
  2. Via the GitLab Nav, go to Code -> Repository
  3. Select to add a file. In the bottom of the UI, change the branch to the new branch name:

image

  1. Error at the top of the page:

image

Video also included.

Example Project

Here is the project I am using to replicate the bug, but my original faux pas was on gitlab.com.

What is the current bug behavior?

User has to change the default branch in settings to use the selected branch if it already exists.

What is the expected correct behavior?

Form accepts the branch. If the branch already exists, the file should still be able to upload to the target branch.

Relevant logs and/or screenshots

See above.

Output of checks

This bug happens on GitLab.com

Edited by 🤖 GitLab Bot 🤖