Why does git say “Pull is not possible because you have unmerged files”?

What is currently happening is, that you have a certain set of files, which you have tried merging earlier, but they threw up merge conflicts. Ideally, if one gets a merge conflict, he should resolve them manually, and commit the changes using git add file.name && git commit -m “removed merge conflicts”. Now, another user … Read more

Does “git fetch –tags” include “git fetch”?

Note: starting with git 1.9/2.0 (Q1 2014), git fetch –tags fetches tags in addition to what are fetched by the same command line without the option. To fetch only tags: git fetch <remote> ‘refs/tags/*:refs/tags/*’ In details: See commit c5a84e9 by Michael Haggerty (mhagger): Previously, fetch’s “–tags” option was considered equivalent to specifying the refspec refs/tags/*:refs/tags/* … Read more

fetch in git doesn’t get all branches

The problem can be seen when checking the remote.origin.fetch setting (The lines starting with $ are bash prompts with the commands I typed. The other lines are the resulting output) $ git config –get remote.origin.fetch +refs/heads/master:refs/remotes/origin/master As you can see, in my case, the remote was set to fetch the master branch specifically and only. … Read more

What does FETCH_HEAD in Git mean?

FETCH_HEAD is a short-lived ref, to keep track of what has just been fetched from the remote repository. git pull first invokes git fetch, in normal cases fetching a branch from the remote; FETCH_HEAD points to the tip of this branch (it stores the SHA1 of the commit, just as branches do). git pull then … Read more

Having a hard time understanding git-fetch

First, there’s no such concept of local tracking branches, only remote tracking branches. So origin/master is a remote tracking branch for master in the origin repo. Typically you do git fetch $remote which updates all your remote tracking branches, and creates new ones if needed. However, you can also specify a refspec, but that will … Read more

Retrieve specific commit from a remote Git repository

Starting with Git version 2.5+ (Q2 2015), fetching a single commit (without cloning the full repo) is actually possible. See commit 68ee628 by Fredrik Medley (moroten), 21 May 2015. (Merged by Junio C Hamano — gitster — in commit a9d3493, 01 Jun 2015) You now have a new config (on the server side) uploadpack.allowReachableSHA1InWant Allow … Read more