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
28
votes
3 answers

Can I tell git pull to overwrite instead of merge?

As far as I see, git pull someRemote master tries to merge the remote branch into mine. Is there a way to say "Completely discard my stuff, just make me another clone of the remote" using git pull? I still want to keep my own repository and keep…
Michael Stum
  • 177,530
  • 117
  • 400
  • 535
27
votes
3 answers

How do I pull down a remote branch?

I've been searching for a half hour for how to do pull a remote branch, and cannot figure it out. My remote git repository has a branch called frontend. When I run git pull origin frontend I get the following output: * branch frontend …
Christopher Shroba
  • 7,006
  • 8
  • 40
  • 68
27
votes
2 answers

Difference between TortoiseGit Git Sync and Pull?

I am comming from a SVN environment and I am exploring Git with TortoiseGit. When I right-click a 'checked-out' Git repository, I can perform a Git Sync command, but also a Pull command. What is the difference between those two functions precisely?
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
27
votes
1 answer

"Proper" way to pull git "production branch" to production server

I'm quite new to Git, and have read the Pro Git book @ http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging. My question is if what I'm doing today is the prefered way to work with production server and a remote Git repo. I have my…
dropson
  • 1,111
  • 2
  • 12
  • 23
26
votes
1 answer

What is the difference between clone and mkdir->cd->init->remote-add->pull?

After setting up a repo on Github, there seems to be two ways to pull that repo into a local repo. Firstly, I could create a directory, initialize a blank repo, add a remote and then pull changes from the remote. > mkdir "exampleProject" > cd…
Rupert Madden-Abbott
  • 12,899
  • 14
  • 59
  • 74
26
votes
4 answers

error: The following untracked working tree files would be overwritten by checkout

When I do git status it says nothing to commit, working directory clean And then I do git pull --rebase, it says: First, rewinding head to replay your work on top of it... error: The following untracked working tree files would be overwritten by…
randomor
  • 5,329
  • 4
  • 46
  • 68
25
votes
2 answers

GIT pull/fetch from specific tag

Is there a way to pull/fetch code from a specific tag in a repo. Am aware that after clone, i can checkout to the tag but is it possible to specify a tag during a pull? In ClearCase i can rebase or deliver a specific baseline of code, is there a way…
Senthil A Kumar
  • 10,306
  • 15
  • 44
  • 55
25
votes
4 answers

Git pull a branch from a different repository

I've few files in my current repository. I want to merge a remote branch from a different repository. Pull and merge a branch from github.com/username/code.git (branch loader) Then pull and merge a branch from github.com/username/code.git (branch…
user689751
25
votes
9 answers

Git no space left on device

I did git pull --rebase and I got following error: error: file write error (No space left on device) fatal: unable to write sha1 file fatal: unpack-objects failed I have lot of space on my device. Don't know why it is showing this error. First…
Rahul Tapali
  • 9,887
  • 7
  • 31
  • 44
25
votes
5 answers

Avoid recompilation with git and make

I have two development branches in git and I frequently need to change between the two. However, the really frustrating thing is that every time I change branches in git, the entire project gets rebuilt because the file-system timestamps for some…
owagh
  • 3,428
  • 2
  • 31
  • 53
23
votes
4 answers

How do I pull/fetch with Git *INTO* a bare repository?

I'm writing a tool to backup all my repositories from Bitbucket (which supports Git and Mercurial) to my local machine. It already works for Mercurial, where I do it like this: create a new empty repository without a working copy on the local…
Christian Specht
  • 35,843
  • 15
  • 128
  • 182
23
votes
1 answer

How to make a second github pull request when one is already pending

I've used other revision control systems before but have little experience with git and github. I wanted to contribute to a project, so I forked it on github, fetched a local copy of my fork, edited it, committed it, pushed the change back to my…
user3496878
  • 247
  • 2
  • 3
22
votes
3 answers

Git fetch and pull with no arguments

I have a git branch checked out named foo. > git status # On branch foo nothing to commit (working directory clean) It was originally checked out using this command: > git checkout origin/foo -b foo --track I want to get updates to this branch…
Matt Ball
  • 354,903
  • 100
  • 647
  • 710
22
votes
1 answer

! [remote rejected] master -> master (failure) error: failed to push some refs to ‘repository URL’

I have already seen the question failed to push some refs to git@heroku.com and I'm the only developer of the following private repository which just has a master branch From my searches I've seen that this error typically occurs when your local…
Sepideh Abadpour
  • 2,550
  • 10
  • 52
  • 88
22
votes
4 answers

How to force pull before push

Every time I want to push my commits (git commit -m "message", git push origin ), I do a pull (git pull origin ). Is there any way to make git do a pull before performing my push? (on the same branch)
Ali Farhoudi
  • 5,350
  • 7
  • 26
  • 44