Error git push error ": src refspec xxx does not match any." using git stream

I used to create repo on my private git server

git init --bare Initialized empty Git repository in /home/poc/git_repo/local_display_multi_langs .git/ 

Then I tried add remote in my working copy on my mac.

 git remote add origin ssh:// poc@172.19.16.101 /home/poc/git_repo/local_display_multi_langs.git 

The following commands are executed

  514 git flow init 519 git flow feature start read_xml 524 git ci -am "first ci" 

Then I tried to drag all the branches to my private git server and got exceptions following

 [src] $ git push origin feature poc@172.19.16.101 password: error: src refspec feature does not match any. error: failed to push some refs to 'ssh:// poc@172.19.16.101 /home/poc/git_repo/local_display_multi_langs.git' 

Am I missing or misusing some steps?

How to transfer all branches to my working copy on a remote server?

Then when I clone the project from my git server.

How to get a new cloned project and the original project are identical.

thanks

Thanks for @VonC

Now I can direct all branches on my local working copy to a remote server

git push origin --all

But when I do git clone ssh:// poc@172.19.16.101 /home/poc/git_repo/local_display_multi_langs.git in another folder.

 [local_display_multi_langs] $ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/develop remotes/origin/feature/read_xml remotes/origin/master 

I saw these branches, which are strange to me.

Because I expect to get the same results as the original working copy, as shown below.

Is there any way to get clone from my remote server and restore the status as the original working copy

 [local_display_multi_langs] $ git br develop * feature/read_xml master 
+6
source share
1 answer

How can I redirect all branches of my working copy to a remote server?

You can do at least a:

 git push origin --all 

' feature ' is a git -flow command, not a branch name.
See gitflow cheatsheet .

translate ' feature ' into the branch namespace, defining the branch hierarchy .
Clicking only these function branches will:

 git push origin refs/heads/feature/*:refs/remotes/origin/feature/* 

Or you can register refspec in a .gitconfig file .

+1
source

Source: https://habr.com/ru/post/959366/


All Articles