Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git pull not working

Tags:

git

I am not using github. We have git setup on our machine.

I created a branch from master called experiment. However when I am trying to do git pull I am getting following message.

> git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.experiment.merge' in
your configuration file does not tell me either.    Please
specify which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.

Here is result of git remote show origin

> git remote show origin
* remote origin
  Fetch URL: ssh://git.domain.com/var/git/app.git
  Push  URL: ssh://git.domain.com/var/git/app.git
  HEAD branch: master
  Remote branches:

    experiment      tracked
    master          tracked
  Local branches configured for 'git pull':
    master     merges with remote master
  Local refs configured for 'git push':
    experiment pushes to experiment (local out of date)
    master     pushes to master     (up to date)

As I read the message above experiment is mapped to origin/experiment. And my local repository knows that it is out of date. Then why I am not able to do git pull?

This is how I created this branch

git co -b experiment origin/experiment

like image 454
Nick Vanderbilt Avatar asked Mar 12 '10 15:03

Nick Vanderbilt


People also ask

Why is git pull not pulling latest commit?

One explanation would be that the latest commits have been done on another branch, as explained in "Git pull from my public repository not working". The other possibility is for you to be in a detached HEAD mode. That would make any git pull "up-to-date" since you are in any branch.

How do I fix a git pull error?

How to Fix error: failed to push some refs to Error in Git Using git pull --rebase. The git pull --rebase command is helpful in situations where your local branch is a commit behind the remote branch.

Why git pull is not updating my local branch?

git pull Not Updating Files Due to Uncommitted Files in Your Local Repository. As a source code management system, Git does its best to prevent you from losing your files and data. For this reason, Git may refuse to merge your local files with files from your remote repository when performing the git pull command.

How do I force git to pull a file?

git pull --force it feels like it would help to overwrite local changes. instead, it fetches forcefully but does not merge forcefully ( git pull --force = git fetch --force + git merge ). Like git push, git fetch allows us to specify which local and remote branch we want to work on.


1 Answers

Pull:

git pull origin experiment

Push:

git push origin experiment
like image 152
Stewie Griffin Avatar answered Sep 22 '22 09:09

Stewie Griffin