Pull a certain branch from the remote server

But I get an error “! [rejected]” and something about “non fast forward” That’s because Git can’t merge the changes from the branches into your current master. Let’s say you’ve checked out branch master, and you want to merge in the remote branch other-branch. When you do this: $ git pull origin other-branch Git is … Read more

How to pull specific directory with git

cd into the top of your repo copy git fetch git checkout HEAD path/to/your/dir/or/file Where “path/…” in (3) starts at the directory just below the repo root containing your “…/file“ NOTE that instead of “HEAD”, the hash code of a specific commit may be used, and then you will get the revision (file) or revisions … 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