Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9b992e6f
Commit
9b992e6f
authored
Jul 19, 2021
by
Katrin Leinweber
Committed by
Amy Qualls
Jul 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs: Troubleshoot default branch being reset
parent
df93b3d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
doc/user/project/repository/branches/default.md
doc/user/project/repository/branches/default.md
+23
-0
No files found.
doc/user/project/repository/branches/default.md
View file @
9b992e6f
...
...
@@ -171,3 +171,26 @@ current default branch, instead of displaying the "not found" page.
-
[
Discussion of default branch renaming
](
https://lore.kernel.org/git/pull.656.v4.git.1593009996.gitgitgadget@gmail.com/
)
on the Git mailing list
-
[
March 2021 blog post: The new Git default branch name
](
https://about.gitlab.com/blog/2021/03/10/new-git-default-branch-name/
)
## Troubleshooting
### Unable to change default branch: resets to current branch
We are tracking this problem in
[
issue 20474
](
https://gitlab.com/gitlab-org/gitlab/-/issues/20474
)
.
This issue often occurs when a branch named
`HEAD`
is present in the repository.
To fix the problem:
1.
In your local repository, create a new, temporary branch and push it:
```
shell
git checkout
-b
tmp_default
&&
git push
-u
origin tmp_default
```
1.
In GitLab, proceed to
[
change the default branch
](
#change-the-default-branch-name-for-a-project
)
to that temporary branch.
1.
From your local repository, delete the
`HEAD`
branch:
```
shell
git push
-d
origin HEAD
```
1.
In GitLab,
[
change the default branch
](
#change-the-default-branch-name-for-a-project
)
to the one you intend to use.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment