Error pushing changes on GIT. Ref names must follow git ref-format rules

As per 22nd of November 2019 this finally seems to be fixed.

SourceTree 3.3.6 [22 November 2019]
  Changes
    Fixed new branches in the push dialog not setting the remote branch name
    Fixed the create patch screen allowing split view

Source: SourceTree Release Notes


This seems to be a bug affecting SourceTree for Windows version 3.3.4: https://jira.atlassian.com/browse/SRCTREEWIN-12593

A workaround until the bug is fixed is to untick and retick the branch checkbox in the push dialog.


The problem is not with your local branch name. The problem is with the branch name you asked the other Git to use.

Here's that error message again, this time in fixed-width font for clarity:

The Remote branch '' (Local branch = 'sprints/Mycompany_sprint-1') is invalid.

Remove the parenthetical remark, which is merely informational:

The Remote branch '' is invalid.

You have—somehow; this should be impossible—specified a remote branch name that is completely empty. That's not a valid branch name. How you specified it, I have no idea, but you need to stop doing that.