0

I have got new design project in localhost and I have gotten github account with old design. I want to upload it to new branch.

  1. I create new branch with web interface on the github "new-design".
  2. I create local git repo: #git init
  3. I add the remote repo: #git remote add github url
  4. I add files and commit it all: #git add -A, #git commit
  5. Now I want to upload it to github, I run: #git push github new-design

error: src refspec new-design does not match any.

What I must to do? How push it to new-design brunch on the github server?

HSchmale
  • 1,838
  • 2
  • 21
  • 48
butteff
  • 115
  • 2
  • 9

1 Answers1

2

You need to make sure that local repo branch name matches the remote branch name. When you create a new local repo the name of the branch is called master, and that probably already exists in the remote you are trying to push to.

To rename your local branch see: https://stackoverflow.com/a/6591218/4335488

Or you can just run this command on the local repo, then push it to the github remote.

git branch -m new-design
Community
  • 1
  • 1
HSchmale
  • 1,838
  • 2
  • 21
  • 48
  • Thank you. I have got this problem: error: failed to push some refs to 'https://github.com/***' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. – butteff Jun 15 '15 at 23:58
  • If I will pull it, all my changes will be gone? – butteff Jun 15 '15 at 23:58
  • @gggigi If you don't have anything on the remote branch delete the remote and push the local branch again. – HSchmale Jun 16 '15 at 00:00