3

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.

Psytho
  • 3,313
  • 2
  • 19
  • 27
Pavel Poley
  • 5,307
  • 4
  • 35
  • 66
  • Possible duplicate of [Why do I need to explicitly push a new branch?](https://stackoverflow.com/questions/17096311/why-do-i-need-to-explicitly-push-a-new-branch) – Psytho Mar 01 '18 at 15:32

2 Answers2

3

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.

0

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

Ryan
  • 658
  • 8
  • 22