butteff
butteff

Reputation: 125

How to push local git repo to remote branch?

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?

Upvotes: 0

Views: 431

Answers (1)

HSchmale
HSchmale

Reputation: 1929

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

Upvotes: 2

Related Questions