Questions tagged [git-fetch]

git-fetch - Download objects and refs from another repository

The git command fetch retrieves changes done in a remote repository.

It will not merge the changes automatically into your local branches, use git pull for this or merge from the origin-branch after doing fetch.

See the man page for full details.

397 questions
39
votes
5 answers

git pull origin master does not update origin/master?

According to the documentation, git pull performs a git fetch then a git merge, however in that case performing git pull origin master should perform a git fetch origin master right? However, it does not appear to be doing so. Here is an…
Kenneth Baltrinic
  • 2,941
  • 2
  • 28
  • 45
39
votes
5 answers

How to undo 'git fetch'

I just added additional remote A to my repo B and then run git fetch A. How can I undo the fetch? If I just remove remote A: git remote remove A1 would it undo fetch? UPDATE: $ git remote add A path/to/A $ git fetch A The above are commands I run…
Sergino
  • 10,128
  • 30
  • 98
  • 159
38
votes
2 answers

git fetch doesn't update my local repository

What I want: Update all new commits from server with my local repository in all branch but do not merge any branch (just join the history lines). I am trying this command git fetch --force --progress --verbose name@host:/path/to/repository.git I…
Rodrigo
  • 11,909
  • 23
  • 68
  • 101
38
votes
3 answers

Git fetch origin vs git fetch --all

What is the difference between the following git commands? git fetch origin and git fetch --all Running them from the command line looks like they do the same thing.
Tony Scialo
  • 5,457
  • 11
  • 35
  • 52
38
votes
3 answers

git fetch vs. git fetch origin master have different effects on tracking branch

This is mostly of the nature of a curiosity as I'm trying to get familiar with Git. I have looked at the documentation for 'git fetch' but I don't see an obvious explanation for the below. Thanks in advance, and apologies if this is howlingly…
Xoanon93
  • 485
  • 1
  • 4
  • 7
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
27
votes
6 answers

What's the difference among "git fetch && git checkout" versus "git checkout" only?

Should do we always do as: git fetch && git checkout Or only, git checkout ? For example when doing a checkout from a branch in bitbucket they provide the command as: git fetch && git checkout develop But why is this necessary if git…
mario ruiz
  • 880
  • 1
  • 11
  • 28
27
votes
3 answers

Jenkins (Windows) very slow Git fetch

We are experiencing slow git fetch commands on a Jenkins installation on Windows Server 2012. I have tried all the solutions mentioned in these threads: Hudson git commands are *incredibly* slow (Using plink.exe from PuTTY and setting GIT_SSH to…
Thomas T
  • 697
  • 1
  • 7
  • 19
25
votes
1 answer

Is there any reason to not set 'git fetch' to always use the --prune option?

Using git fetch --prune deletes local remote tracking branches when the branch on the remote machine has been deleted. Setting remote.origin.prune to true using the following... git config --global fetch.prune true ...makes using the fetch command…
timfoil
  • 415
  • 4
  • 11
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
6 answers

git fetch --unshallow gives :"fatal: --unshallow on a complete repository does not make sense" error

I am unable to git clone a remote repository using plain git clone path I get the error "The remote end hung up unexpectedly". The complete msg I get is : Cloning into 'xyzabc'... remote: Counting objects: 4328, done. remote: Compressing objects:…
Rohit Rane
  • 2,790
  • 6
  • 25
  • 41
24
votes
4 answers

Default remote for git fetch

If I am on a local branch that is not tracking any remote branch and I give the command git fetch Given I have several remotes defined in $GIT_DIR/config, from which remote is the fetch done? I tried to find out from the man page, but this point is…
Klas Mellbourn
  • 42,571
  • 24
  • 140
  • 158
24
votes
4 answers

Reverse a git fetch

I have a thorough understanding of git, and the difference between pull, fetch, and merge. I have a remote that I track, fetch, and merge with occasionally, let say it's origin/master. What I'm looking to do is reverse the behavior of a 'git…
user2141094
  • 243
  • 1
  • 2
  • 4
23
votes
2 answers

How do you git fetch then merge? "Error: Your local changes to the following files would be overwritten by merge"

Newbie Git question: I have a repo set up on bitbucket. I git fetched someone else's changes and would like to merge them with my own. However, when I try to git merge (or git merge origin/master), I get the message "error: Your local changes to the…
ario
  • 1,727
  • 4
  • 19
  • 28
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
1 2
3
26 27