git-fetch

git fetch, FETCH_HEAD and origin/master

流过昼夜 提交于 2019-12-17 06:42:29
问题 I'm very new to git and I'm having trouble with a simple fetch operation. I'm trying to fetch a coworker's progress from his repository. At first I did git fetch HEAD which prompted git to download about 350MB of data so I was sure it had done something. However, origin/master ended up still pointing to the same old commit (actually it's under the name dev but I'll call it master - he doesn't have a master ). After that I tried git fetch origin master but it didn't seem to do anything, it

Git fetch remote branch

大城市里の小女人 提交于 2019-12-17 04:37:08
问题 My colleague and I are working on the same repository. We've branched it into two branches, each technically for different projects, but they have similarities, so we'll sometimes want to commit back to the * master from the branch . However, I have the branch . How can my colleague pull that branch specifically? A git clone of the repository does not seem to create the branches locally for him, though I can see them live on unfuddle after a push on my end. Also, when I originally made the

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

老子叫甜甜 提交于 2019-12-17 02:54:06
问题 A nice and simple question - is the function of "git fetch" a strict sub-set of git fetch --tags ? I.e. if I run git fetch --tags , is there ever a reason to immediately run git fetch straight afterward? What about git pull and git pull --tags ? Same situation? 回答1: 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. See commit c5a84e9 by Michael Haggerty (mhagger): Previously, fetch's " --tags "

What does FETCH_HEAD in Git mean?

亡梦爱人 提交于 2019-12-17 02:04:38
问题 git pull --help says: In its default mode, git pull is shorthand for git fetch followed by git merge FETCH_HEAD. What is this FETCH_HEAD , and what is actually merged during git pull ? 回答1: 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

Default remote for git fetch

ε祈祈猫儿з 提交于 2019-12-14 00:15:51
问题 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 unclear to me. Additionally: How can I change this default remote without making the local branch tracking? 回答1: If you have multiple remote repositories, and don't specify any remote repository name, origin will be used by default. If there is no

git - A git fetch / git merge merges without conflicts, but shows almost all files are modified and need to be committed

早过忘川 提交于 2019-12-13 03:48:55
问题 I am very new to git and I have been seeing this every once in a while. For example: I work on my branch branch-A for few days (branch is created from develop fresh copy) I do git add . / git commit -m "blahblah" to stage and commit my changes Now I want to get latest changes from remote and merge it into my branch so I ensure I work on latest code to do so, I do git checkout develop to switch to my local develop branch, git status shows I'm behind 37 commits myMBPro:MyProj$ git status On

git - how to mirror file from other repo

只谈情不闲聊 提交于 2019-12-12 22:30:06
问题 I've a problem which probably can't be solved, but I'll ask anyway. I do have one git repository, and I need one file to be mirrored from another one. There is one .xsd file in the repo I need to have in my repository. That's not the biggest problem. I want to update that file (on git fetch for instance), to the version of the last tag on the repository containing .xsd file. Any help is really appreciated 回答1: You can use post-checkout (or maybe some more appropriate) hook to replace the

Fetch specific commit from remote git repo

为君一笑 提交于 2019-12-12 10:53:41
问题 So, what I'm basically trying to do is to pull down a given commit (identified by its SHA) from one remote repo, and then push it to another remote repo as a new branch (whose name I autogenerate). The source repo will vary and these are all one-shot operations, so I don't want to git remote add these remotes and I don't want to create refs/branches for the commits. And I don't want to change the HEADs of any of my local branches. So, how do I just grab the given remote commit (and any of its

How does git checkout work after git fetch

让人想犯罪 __ 提交于 2019-12-11 14:59:53
问题 I just did git fetch origin <remoteBranch> And after that I just did git checkout <remoteBranch> That created a local branch with the name of <remoteBranch> . How does that just work? Normally when I want to create a local branch I have to do git checkout -b 回答1: The manual for checkout says: git checkout <branch> [...]If <branch> is not found but there does exist a tracking branch in exactly one remote (call it <remote> ) with a matching name, treat as equivalent to $ git checkout -b <branch

GIT isn't fetching my new branch

戏子无情 提交于 2019-12-11 13:10:52
问题 I have created a new branch on my remote, so I would expect to do this: $ git fetch && git checkout feature/name However, I get this error: error: pathspec 'feature/name' did not match any file(s) known to git. When I run git fetch on its own, it doesn't return anything, I have also tried git fetch origin which does not work either. git remote returns just the one remote called origin . My config looks like this: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates