How can I make my local repository available for git-pull?

Five possibilities exist to set up a repository for pull from: local filesystem: git clone /path/to/repo or git clone file://path/to/repo. Least work if you have networked filesystem, but not very efficient use of network. (This is almost exactly solution proposed by Joakim Elofsson) HTTP protocols: git clone http://example.com/repo. You need any web server, and you … Read more

How to undo a git pull?

Or to make it more explicit than the other answer: git pull whoops? git reset –keep HEAD@{1} Versions of git older than 1.7.1 do not have –keep. If you use such version, you could use –hard – but that is a dangerous operation because it loses any local changes. To the commenter ORIG_HEAD is previous … Read more

Trying to git pull with error: cannot open .git/FETCH_HEAD: Permission denied

It seems like the first one isn’t working because your user doesn’t have the permissions for changing that directory, and the second because your root user doesn’t have the right SSH keys for accessing that git repository. Depending on what you’re trying to do, it might be better to clone the repository to a different … Read more

Create new pull request from fork without having commits of the previous fork

To really understand this, we need to define some things. First, there’s a bit of a problem here because “pull request” is not a Git thing itself. You have included the tag github and GitHub does define “pull request”—in fact, they’ve re-defined it at least once; see this early 2013 answer from VonC, revised numerous … Read more

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