Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No refs in common and none specified; doing nothing

Tags:

git

gitolite

I had a local git project that I wanted to add to gitolite. Apparently this is hard so I abandoned the idea. I created a new gitolite repo by adding it to gitolite-admin/conf/gitolite.conf and committing and pushing the changes. Then I cloned the new repo with git clone git-noah:project-name successfully. I then copied all files and folders except .git to the project-name folder. I did,

git add -A git commit -a -m "Moved to new repo." git push 

I get this error:

warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use:    git config --global push.default matching  To squelch this message and adopt the new behavior now, use:    git config --global push.default simple  See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git)  No refs in common and none specified; doing nothing. Perhaps you should specify a branch such as 'master'. fatal: The remote end hung up unexpectedly error: failed to push some refs to 'git-noah:project-name' 
like image 569
Noah Avatar asked May 07 '14 21:05

Noah


2 Answers

No "main" exists yet on the remote (origin) repository.

git push origin main 

After this first push you can use the simpler

git push 

Edit: With the recent trends my answer has been update to replace "master" with "main"

like image 166
Oliver Avatar answered Sep 25 '22 14:09

Oliver


If you are receiving error:

No refs in common and none specified; doing nothing. Perhaps you should specify a branch. 

But not receiving error:

warning: push.default is unset 

Make sure you have run git commit before attempting to run git push

like image 41
pirateofebay Avatar answered Sep 26 '22 14:09

pirateofebay