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.

1231 questions
39
votes
2 answers

git: Why "Merge branch 'master' of ... "? when pull and push

I'm still git newbie. I modified some source files and committed. Then, I did git push. But, I got this error. To /foo/bar/ ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to '/foo/bar/' To prevent you…
Nullptr
  • 3,103
  • 4
  • 27
  • 28
38
votes
1 answer

Convert merge into rebase without having to perform the merge again

I made a mistake: I should have used git pull --rebase, but I issued a simple git pull, merged everything and now have a merge commit at the HEAD of my branch. I want to get rid of that merge commit and I thought I'd just issue a git rebase -i…
Confusion
  • 16,256
  • 8
  • 46
  • 71
36
votes
3 answers

git pull says up-to-date but git push rejects non-fast forward

I've just pulled a new branch, made some local changes, committed and tried to push. I was given this error: ! [rejected] groups -> groups (non-fast forward) So I tried a to pull but was told Already up-to-date. Here's what I get pulling then…
Jake
  • 12,713
  • 18
  • 66
  • 96
36
votes
4 answers

Git pull from someone else's fork

We are two students working on our online repository (different repo) that is forked from a common upstream repo. Let's say other student made Changes, Commits and Pushed to his repo on a specific branch. How do I pull these changes into my own…
M.A.B
  • 541
  • 2
  • 5
  • 6
36
votes
4 answers

How can I pull all branches in SourceTree?

I didn't see any options to do this in the pull window. What should I do?
Harrison Xi
  • 766
  • 1
  • 5
  • 23
36
votes
2 answers

Why do I see a deleted remote branch?

I have a remote repository and 2 clones. I create a branch in one of the clones e.g. test. I do some work and 2 commits. I merge to master branch and push -u the branch. I do a git pull in the other clone. I see both master and test. In the first…
Cratylus
  • 52,998
  • 69
  • 209
  • 339
35
votes
6 answers

pull remote branch without merge

I've created a branch b1 and I made some changes on it and I push it to the remote repository: git branch b1 git checkout b1 git add newfile.txt git commit -m "adding a new file" git push origin b1 On an other machine which is connected to the…
Carole
  • 749
  • 1
  • 6
  • 18
34
votes
3 answers

"git pull --rebase" leads to "Cannot rebase onto multiple branches"

So, my work environment has precisely one branch with a remote companion on Github. I'm trying to do git pull --rebase in order to prevent git push from creating merge commit messages that don't provide new information to others working on this…
bourgtai
  • 367
  • 1
  • 4
  • 9
34
votes
13 answers

Sourcetree/GIT - Cannot lock ref/reference broken, when pulling

A co-worker and I have been working on the same branch for a week, constantly pushing/pulling changes and all of a sudden today, I hit 'pull' to see if there were any changes I needed to pull and I got an error. This is in sourcetree by the way. The…
Geoff_S
  • 4,917
  • 7
  • 43
  • 133
34
votes
4 answers

Merging Issues with Git

I am using git version 1.7.11.msysgit.0 I created a repository under GitHUB and added a file called as README.md with some text content . Later on , I have installed GIT Client , did a clone to get the server contents on to my machine . Then I…
Pawan
  • 31,545
  • 102
  • 256
  • 434
32
votes
1 answer

How to configure "git pull --ff-only" and "git merge --no-ff"

A typical git workflow for me is to clone a remote repository and use git pull to keep it up-to-date. I don't want merge commits when I pull, so i use the --ff-only option. I also make local branches for feature work. I want to preserve the branch…
Robert Huffman
  • 367
  • 1
  • 3
  • 6
31
votes
5 answers

What is the difference between git pull and git reset --hard origin/?

I find the latter to be faster than the first, so I usually do that after git fetch whenever I need to sync my local branch with the remote. What is the difference?
technophyle
  • 7,972
  • 6
  • 29
  • 50
31
votes
2 answers

How to config git to pull from http and push through ssh in one 'remote'?

Pulling from http to escape authentication(so I don't need to type password if I'm not using ssh.keygen). Pushing through ssh with authentication.
Tsung.W
  • 289
  • 1
  • 4
  • 8
31
votes
2 answers

Git-SVN: Update Git repo from centralized SVN server

I'm working on a project for which everyone uses SVN as a centralized server and everybody pushes the changes they do on that server. I want to use Git locally and I'm pretty new to git svn. I did a git svn clone of the repository with git svn clone…
Jacob Krieg
  • 2,834
  • 15
  • 68
  • 140
29
votes
3 answers

Git pull origin HEAD

I was taught that you could push to and pull from a remote branch matching the name of your current Git branch by doing: git push origin HEAD or git pull origin HEAD Its always worked for me before, but it strangely doesn't work sometimes, instead…
Rican7
  • 1,125
  • 2
  • 10
  • 28