Questions tagged [git-pull]

Fetches changes from a remote repository and incorporates them into the current branch of a Git repository.

git pull is used whenever changes from a remote repository need to be fetched and incorporated into the local repository. Internally git pull first performs a git fetch to get the remote branches updated and then a git merge to incorporate the changes into the current branch.

1078 questions
12539
votes
38 answers

What is the difference between 'git pull' and 'git fetch'?

What are the differences between git pull and git fetch?
pupeno
  • 256,034
  • 114
  • 324
  • 541
8002
votes
50 answers

How do I force "git pull" to overwrite local files?

How do I force an overwrite of local files on a git pull? The scenario is the following: A team member is modifying the templates for a website we are working on They are adding some images to the images directory (but forgets to add them under…
Jakub Troszok
  • 84,701
  • 10
  • 36
  • 49
1595
votes
25 answers

Git push requires username and password

I cloned a Git repository from my GitHub account to my PC. I want to work with both my PC and laptop, but with one GitHub account. When I try to push to or pull from GitHub using my PC, it requires a username and password, but not when I'm using…
TooCooL
  • 17,593
  • 6
  • 26
  • 42
947
votes
15 answers

Update Git submodule to latest commit on origin

I have a project with a Git submodule. It is from an ssh://... URL, and is on commit A. Commit B has been pushed to that URL, and I want the submodule to retrieve the commit, and change to it. Now, my understanding is that git submodule update…
Thanatos
  • 37,926
  • 14
  • 76
  • 136
850
votes
16 answers

Rename master branch for both local and remote Git repositories

I have the branch master which tracks the remote branch origin/master. I want to rename them to master-old both locally and on the remote. Is this possible? For other users who tracked origin/master (and who always updated their local master branch…
Albert
  • 57,395
  • 54
  • 209
  • 347
724
votes
18 answers

Merge, update, and pull Git branches without using checkouts

I work on a project that has 2 branches, A and B. I typically work on branch A, and merge stuff from branch B. For the merging, I would typically do: git merge origin/branchB However, I would also like to keep a local copy of branch B, as I may…
charles
  • 9,897
  • 3
  • 28
  • 44
700
votes
14 answers

There is no tracking information for the current branch

I've been using github from a relatively short period, and I've always used the client to perform commits and pulls. I decided to try it from the git bash yesterday, and I successfully created a new repo and committed files. Today I did changes to…
valerio0999
  • 9,029
  • 6
  • 24
  • 52
692
votes
31 answers

git pull fails "unable to resolve reference" "unable to update local ref"

Using git 1.6.4.2, when I tried a git pull I get this error: error: unable to resolve reference refs/remotes/origin/LT558-optimize-sql: No such file or directory From git+ssh://remoteserver/~/misk5 ! [new branch] LT558-optimize-sql ->…
Gabrielle
  • 7,049
  • 4
  • 15
  • 6
681
votes
35 answers

How do I ignore an error on 'git pull' about my local changes would be overwritten by merge?

How do I ignore the following error message on Git pull? Your local changes to the following files would be overwritten by merge What if I want to overwrite them? I've tried things like git pull -f, but nothing works. To be clear, I only want to…
mae
  • 12,340
  • 8
  • 28
  • 40
567
votes
12 answers

Git Pull While Ignoring Local Changes?

Is there a way to do a git pull that ignores any local file changes without blowing the directory away and having to perform a git clone?
markdorison
  • 115,110
  • 27
  • 52
  • 69
414
votes
5 answers

In what cases could `git pull` be harmful?

I have a colleague who claims that git pull is harmful, and gets upset whenever someone uses it. The git pull command seems to be the canonical way to update your local repository. Does using git pull create problems? What problems does it create?…
Richard Hansen
  • 44,218
  • 20
  • 84
  • 95
383
votes
3 answers

Git pull after forced update

I just squashed some commits with git rebase and did a git push --force (which is evil, I know). Now the other software engineers have a different history and when they do a git pull, Git will merge. Is there a way to fix this, except doing a rm…
iblue
  • 26,668
  • 17
  • 81
  • 125
334
votes
5 answers

Difference between git pull and git pull --rebase

I started using git sometime back and do not fully understand the intricacies. My basic question here is to find out the difference between a git pull and git pull --rebase , since adding the --rebase option does not seem to do something very…
Rndm
  • 6,270
  • 7
  • 36
  • 58
315
votes
2 answers

Resolve conflicts using remote changes when pulling from Git remote

I'm trying to pull code from my GitHub repo onto my server, but the pull keeps failing because of merge conflicts. I don't want to keep any of the changes that may have occurred on my local server since the last pull. So is there a way I can force…
David Tuite
  • 20,708
  • 23
  • 93
  • 167
306
votes
2 answers

What is the difference between git pull and git fetch + git rebase?

Another question says that git pull is like a git fetch + git merge. But what is the difference between git pull and git fetch + git rebase?
michael
  • 93,094
  • 111
  • 230
  • 334
1
2 3
71 72