Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couldn't find remote ref HEAD in Git

I installed bonobo git server on windows 7.

I created a new repository "SFK" through that bonobo.

Then I cloned into that like:

git clone http://localhost/Bonobo.Git.Server/SFK.git
git add "trans.cs"
git commit -m "added"
git push http://localhost/Bonobo.Git.Server/SFK.git

Everything works.

Bit When I try to pull using

git pull http://localhost/Bonobo.Git.Server/SFK.git

It gives this error

fatal:
Couldn't find remote ref HE
Unexpected end of command stream

Where am I going wrong? I am new to this git and bonobo. please suggest how to rectify this.

UPDATE:

I tried this after push.

git config --global pull.default current
git config --global push.default current

It worked.

like image 651
shanmugharaj Avatar asked Nov 25 '13 05:11

shanmugharaj


People also ask

How do I set up remote origin?

To add a new remote, use the git remote add command on the terminal, in the directory your repository is stored at. The git remote add command takes two arguments: A remote name, for example, origin.

What is the pull command in git?

The git pull command is used to fetch and download content from a remote repository and immediately update the local repository to match that content.

What is git pull origin master?

'git pull origin master' will fetch and update only a specific branch called master and origin in the remote repository. Often, the default branch in Git is a master branch, and it keeps updating frequently. A user can use any branch name to pull that branch from the remote.

What is the push command in git?

The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo. It's the counterpart to git fetch , but whereas fetching imports commits to local branches, pushing exports commits to remote branches.


1 Answers

Those settings allow git to know what to push to or what to pull from:

push the current branch to update a branch with the same name on the receiving end. Works in both central and non-central workflows.

It should only be:

git config --global push.default current

(I am not aware of that setting for pull)

I would recommend:

  • using the remote name instead of its url: origin
  • using a push with makes a tracking connection between your local and upstream branch:

So:

git push -u origin master
git pull origin

After that, a simple git push will be enough: see "Why do I need to explicitly push a new branch?" for more.

like image 98
VonC Avatar answered Sep 21 '22 03:09

VonC