git-fetch

Are “git fetch --tags --force” and “git pull <branch>” conmutative operations?

久未见 提交于 2019-12-21 22:58:36
问题 Normally the git tags are a fixed reference to a commit. But sometimes they are used to mark some event ( last-build , base-line , etc..) and they change frequently. I have an script that refreshes those kind of "floating" tags from the reference repository. git fetch --tags --force and also make pull from one branch: git pull origin <mybranch> I know that many git users warn about using floating tags, but i am forced to deal with that. My question is: If the branch is marked by one of those

GIT pull/fetch from specific tag

我们两清 提交于 2019-12-20 09:47:48
问题 Is there a way to pull/fetch code from a specific tag in a repo. Am aware that after clone, i can checkout to the tag but is it possible to specify a tag during a pull? In ClearCase i can rebase or deliver a specific baseline of code, is there a way where i can use git tags similarly to pull/push code upto a specified tag? 回答1: It will be a bit different with ClearCase, because you can only rebase a baseline produced on the parent Stream (although you can deliver any baseline from any Stream

How to pull a single file from a server repository in Git?

久未见 提交于 2019-12-20 08:00:13
问题 I am working on a site with a server running Git. I am using Git for deployment (not GitHub). This was set up prior to my involvement using a hook method, and I referred to this question and entered the commands below, but it didn't work. How do I pull a single file from the server? For instance, if I wanted to update my local file index.php? git pull index.php ? 回答1: It is possible to do (in the deployed repository): git fetch // git fetch will download all the recent changes, but it will

Reverse a git fetch

﹥>﹥吖頭↗ 提交于 2019-12-18 11:44:27
问题 I have a thorough understanding of git, and the difference between pull, fetch, and merge. I have a remote that I track, fetch, and merge with occasionally, let say it's origin/master. What I'm looking to do is reverse the behavior of a 'git fetch'. It sounds goofy, but I want to un-update where my remote tracking branch points, to an older state, the state right before the last fetch. Is this possible? For example, lets say this is my workflow... git show origin/master # shows commit abc123

Where to find changes due to `git fetch`

走远了吗. 提交于 2019-12-18 10:26:34
问题 I didn't want to lose some information after a git pull , so I did a git fetch before. Where can I read the new modifications after a git fetch ? I went to the FETCH_HEAD file, but there was nothing more than a big number. 回答1: 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

The following untracked working tree files would be overwritten by merge, but I don't care

丶灬走出姿态 提交于 2019-12-17 21:38:03
问题 On my branch I had some files in .gitignore On a different branch those files are not. I want to merge the different branch into mine, and I don't care if those files are no longer ignored or not. Unfortunately I get this: The following untracked working tree files would be overwritten by merge How would I modify my pull command to overwrite those files, without me having to find, move or delete those files myself? 回答1: The problem is that you are not tracking the files locally but identical

Why is git fetch not fetching any tags?

核能气质少年 提交于 2019-12-17 20:39:14
问题 I have created a sandbox git repository containing a few commits and a couple of tags, one lightweight and one annotated: > mkdir one; cd one; git init > touch a.txt; git add a.txt; git commit -m"a.txt" > touch b.txt; git add b.txt; git commit -m"b.txt" > git tag light > touch c.txt; git add c.txt; git commit -m"c.txt" > git tag -a annot -m"annot" I now create a second repository and fetch from the first: > mkdir two; cd two; git init > git remote add one <...>/one > git fetch one master

Git fetch a branch once with a normal name, and once with capital letter

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 16:41:41
问题 I'm fetching for remote branches and stuck in some sort of a loop. I fetch once and get: $ git fetch * [new branch] minorRelease/something-> origin/minorRelease/something And then I fetch again and get: $ git fetch * [new branch] minorRelease/Something-> origin/minorRelease/Something Same branch but with a capital S . I tried to delete the file from the following folder .git/refs/remotes/origin/minorRelease , but when fetching again, I get both and return to the loop above: $ git fetch * [new

Trying to pull files from my Github repository: “refusing to merge unrelated histories”

好久不见. 提交于 2019-12-17 15:04:36
问题 I'm learning git, and I'm following the Git community book. Previously (long time ago) I made a public repository on Github, with some files. Now I set up a local Git repository on my current computer, and committed some files. Then I added a remote pointing to my Github page: [root@osboxes c]# git remote add learnc https://github.com/michaelklachko/Learning-C That seemed to be successful: [root@osboxes c]# git remote show learnc * remote learnc Fetch URL: https://github.com/michaelklachko

git fetch, FETCH_HEAD and origin/master

痴心易碎 提交于 2019-12-17 06:43:17
问题 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