Pavel Poley
Pavel Poley

Reputation: 5577

Successfully created projecton GitHub, but initial push failed: no current branch

I cannot push project to github, I have this message:

"Successfully created project 'SuperUpTest' on GitHub, but initial push failed: no current branch"

Attached image of commits image description

I need help since i am afraid to break something i really need to push it with all commits.

Upvotes: 3

Views: 5007

Answers (2)

Bakhtiyor Begmatov
Bakhtiyor Begmatov

Reputation: 483

According to photo your current branch has strange name "!" or your had detached from master. In current situation I suggest you next steps:

  • Create another branch (lets name this branch develop) with command

    git checkout -b develop

  • Merge new created branch to master

    git checkout master
    git merge develop

  • Explicitly push your commits (maybe you have to use also --force option after -u)

    git push -u origin master

  • (Optional) Delete develop branch with git branch -d develop

I hope it works.

Upvotes: 3

Ryan
Ryan

Reputation: 688

You need to create a branch first.

git checkout -b master

then you can push

git push origin master

Or optionally, instead of the above 2 commands. Just run this single command:

git push -u origin master

Upvotes: 0

Related Questions