0

I need work with a github repo on development mode.

For work with this proyect and after, upgrade form git (master) create my own git.

On my git server

cd /path/new/repo/l53bp
git init --bare

On local project

git remote add l53bp ssh:mysuser@mygitserver.com:myport/path/new/repo/l53bp

Write some changes.

git add .
git commit -m 'First commit' 

Verify remotes

git remote -v
l53bp   ssh:mysuser@mygitserver.com:myport/path/new/repo/l53bp (fetch)
l53bp   ssh:mysuser@mygitserver.com:myport/path/new/repo/l53bp (push)
origin  https://github.com/rappasoft/laravel-5-boilerplate.git (fetch)
origin  https://github.com/rappasoft/laravel-5-boilerplate.git (push)

Change on master on local

git push -u l53bp master
error: src refspec master does not match any.
error: failed to push some refs to 'ssh:mysuser@mygitserver.com:myport/path/new/repo/l53bp'

What it's wrong?

NOTE: Of course, ssh access to my repo, it's work.

abkrim
  • 3,512
  • 7
  • 43
  • 69

2 Answers2

1

Although you don't show a git checkout -b development or git checkout development command, it's clear from the result from Leon's question:

git status

On branch development
Your branch is ahead of 'origin/development' by 1 commit.
  (use "git push" to publish your local commits)

that you have made your commits on branch development and not on branch master.

The result is that you have no branch master at all (there's nothing wrong with this, it's just a fairly unusual setup). You can verify this with git branch or git branch --list, as Leon notes below.

Since, however, you do in fact lack a master branch, this:

git push -u l53bp master

will fail to push your master branch to remote l53bp.

You may create a master branch (with git branch or git checkout -b or similar), after which you can push it. Or you can push development and never bother with a master.

Community
  • 1
  • 1
torek
  • 448,244
  • 59
  • 642
  • 775
0

You need to do a commit after adding your changed files to stage.

Add to stage:

git add .

Then commit:

git commit -m 'Initial commit'

Have a look at src refspec master does not match any when pushing commits in git . This is the same situation.

Community
  • 1
  • 1
codelab
  • 406
  • 3
  • 14
  • Of course, run this... Question it's about repos not about process on git. Thanks. – abkrim Oct 12 '16 at 09:01
  • Have a look at [http://stackoverflow.com/questions/4181861/src-refspec-master-does-not-match-any-when-pushing-commits-in-git][1] . This is the same situation. – codelab Oct 12 '16 at 09:13
  • Thanks It's similar but not same. I work with develop branch of original github. That's it's problem. I'm try solution but get same result. – abkrim Oct 12 '16 at 09:25