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

Fetch a single tag from remote repository

git fetch origin refs/tags/1.0.0 This fails because it doesn’t write a local reference: it obtains the remote’s refs/tags/1.0.0, and any tag object(s), commits, etc., required to go with it; it drops those into FETCH_HEAD (as all git fetch commands always do); and … that’s it. It never creates reference refs/tags/1.0.0 in your repository, even though … Read more

Where to find changes due to `git fetch`

git fetch origin by default fetches everything from the remote named “origin” and updates (or creates) the so-called “remote-tracking branches” for that remote. Say, for the remote named “origin” which contain branches named “master” and “feature”, running git fetch remote will result in the remote-tracking branches named “origin/master” and “origin/feature” being updated (or created, if … Read more

git refusing to fetch into current branch

In case anyone finds this because they specifically want to fetch into the current branch, you can use the –update-head-ok flag. From the docs: -u –update-head-ok By default git fetch refuses to update the head which corresponds to the current branch. This flag disables the check. This is purely for the internal use for git … Read more

Git removing upstream from local repository

Using git version 1.7.9.5 there is no “remove” command for remote. Use “rm” instead. $ git remote rm upstream $ git remote add upstream https://github.com/Foo/repos.git or, as noted in the previous answer, set-url works. I don’t know when the command changed, but Ubuntu 12.04 shipped with 1.7.9.5. edit: a few people seem to have run … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)