1

I have an existing repo which I connected to my gitlab via ssh

enter image description here

I am just trying to create my branch in sourcetree so that i push my changes there but in getting an error "not a valid object name master"

2

3

is there any part that i skipped because my created repository cant create new branches? thanks for reading any help will be great.

TLDR: created and linked via gitlab repo in sourcetree with an existing one, cant create branch to push

Button Press
  • 623
  • 6
  • 26

1 Answers1

0

Check first if you are creating your branch from an empty repository: there should be at least one commit.

If the repository is not empty, check if:

  • your remote GitLab repository expects a default branch 'main'
  • your local repository uses master as its main branch

If it is the case, rename your local branch

cd /path/to/local/repository
git branch -m master main

And make sure any future local repository starts with main:

git config --global init.defaultbranch main

Try again your branch creation in SourceTree.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250