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.

1141 questions
13061
votes
38 answers

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

What are the differences between git pull and git fetch?
pupeno
  • 264,618
  • 120
  • 339
  • 573
8512
votes
48 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
  • 90,015
  • 10
  • 37
  • 51
1698
votes
27 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
  • 18,721
  • 6
  • 26
  • 43
1025
votes
16 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
  • 39,940
  • 14
  • 78
  • 139
909
votes
39 answers

Support for password authentication was removed. Please use a personal access token instead

I got this error on my console when I tried to use git pull: remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. remote: Please see…
Daemes
  • 7,979
  • 3
  • 3
  • 8
864
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
  • 60,653
  • 58
  • 223
  • 360
790
votes
15 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
  • 10,067
  • 7
  • 27
  • 53
762
votes
37 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
  • 13,501
  • 8
  • 31
  • 41
758
votes
33 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,709
  • 4
  • 15
  • 6
753
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
  • 10,207
  • 3
  • 29
  • 45
619
votes
14 answers

How to `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
  • 124,498
  • 27
  • 52
  • 69
426
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
  • 46,982
  • 20
  • 85
  • 95
422
votes
5 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
  • 27,700
  • 18
  • 83
  • 126
347
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,480
  • 7
  • 36
  • 58
331
votes
7 answers

How to pull remote branch from somebody else's repo

I've got a project hosted on GitHub which somebody has forked. On their fork, they've created a new branch "foo" and made some changes. How do I pull their "foo" into a new branch also named "foo" in my repo? I understand they could submit a pull…
Colin O'Dell
  • 7,679
  • 8
  • 36
  • 74
1
2 3
76 77