git-fetch

“fetch --all” in a git bare repository doesn't synchronize local branches to the remote ones

一个人想着一个人 提交于 2019-11-26 12:44:32
问题 I\'m trying to synchronize periodically a git bare repository, my local branches are created using the \"--track\" option. here is my config (without unnecessary things): [core] bare = true [remote \"origin\"] url = git@github.com:Ummon/D-LAN.git fetch = +refs/heads/*:refs/remotes/origin/* [branch \"master\"] remote = origin merge = refs/heads/master [branch \"website\"] remote = origin merge = refs/heads/website I must use the \'cp\' command to update the local branches: git fetch --all cp

How to update a git clone --mirror?

為{幸葍}努か 提交于 2019-11-26 11:45:33
问题 I have created a git repository to mirror a live site (which is a non-bare git repository): git clone --mirror ssh://user@example.com/path/to/repo Now, to keep this mirror clone updated with all changes from its remote origin, which command or commands I must use? I\'d like to keep everything updated: commits, refs, hooks, branches, etc. Thanks! 回答1: This is the command that you need to execute on the mirror: git remote update 回答2: Regarding commits, refs, branches and " et cetera ", Magnus

Is it possible to pull just one file in Git?

冷暖自知 提交于 2019-11-26 11:45:32
问题 I am working on a Git branch that has some broken tests, and I would like to pull (merge changes, not just overwrite) these tests from another branch where they are already fixed. I know I can do git pull origin that_other_branch but this will attempt to merge lots of other files, for that I am not yet ready. Is it possible to pull and merge only the specified file (and not everything) from that another branch? This is not a duplicate of Git pull request for just one file as all answers to

What does FETCH_HEAD in Git mean?

陌路散爱 提交于 2019-11-26 11:05:34
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 ? 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 invokes git merge , merging FETCH_HEAD into the current branch. The result is exactly what you'd expect: the

Why does git say “Pull is not possible because you have unmerged files”?

烈酒焚心 提交于 2019-11-26 06:12:51
问题 When I try to pull in my project directory in the terminal, I see the following error: harsukh@harsukh-desktop:~/Sites/branch1$ git pull origin master U app/config/app.php U app/config/database.php U app/routes.php Pull is not possible because you have unmerged files. Please, fix them up in the work tree, and then use \'git add/rm <file>\' as appropriate to mark resolution, or use \'git commit -a\'. Why does git say \"Pull is not possible because you have unmerged files\" , and how can I

git pull VS git fetch git rebase

孤人 提交于 2019-11-26 06:10:27
问题 Another question said git pull is like a git fetch + git merge . But what is the difference between git pull VS git fetch + git rebase ? 回答1: It should be pretty obvious from your question that you're actually just asking about the difference between git merge and git rebase . So let's suppose you're in the common case - you've done some work on your master branch, and you pull from origin's, which also has done some work. After the fetch, things look like this: - o - o - o - H - A - B - C

fetch in git doesn&#39;t get all branches

Deadly 提交于 2019-11-26 05:59:13
问题 I have cloned a repository, after which somebody else has created a new branch, which I\'d like to start working on. I read the manual, and it seems dead straight easy. Strangely it\'s not working, and all the posts I\'ve found suggest I\'m doing the right thing. So I\'ll subject myself to the lambasting, because there must be something obviously wrong with this: The correct action seems to be git fetch git branch -a * master remotes/origin/HEAD --> origin/master remotes/origin/master git

Having a hard time understanding git-fetch

家住魔仙堡 提交于 2019-11-25 23:44:27
问题 I am having a hard time understanding the nuances of git-fetch. I understand that doing a fetch , fetches the remote refs into a local tracking branch. I have a few questions though: Can it be possible that a local tracking branch does not exist? If so, will it then be created automatically? What will happen if I do a fetch and specify a non tracking branch as the destination? The man page for git-fetch specifies: git-fetch <options> <repository> <refspec> How would I use the refspec to fetch

Retrieve specific commit from a remote Git repository

六月ゝ 毕业季﹏ 提交于 2019-11-25 22:47:18
问题 Is there any way to retrieve only one specific commit from a remote Git repo without cloning it on my PC? The structure of remote repo is absolutely same as that of mine and hence there won\'t be any conflicts but I have no idea how to do this and I don\'t want to clone that huge repository. I am new to git, is there any way? 回答1: Starting with Git version 2.5+ (Q2 2015), fetching a single commit (without cloning the full repo) is actually possible. See commit 68ee628 by Fredrik Medley

How do I force “git pull” to overwrite local files?

浪尽此生 提交于 2019-11-25 21:49:47
问题 How do I force an overwrite of local files on a git pull ? The scenario is following: A team member is modifying the templates for a website we are working on They are adding some images to the images directory (but forgets to add them under source control) They are sending the images by mail, later, to me I\'m adding the images under the source control and pushing them to GitHub together with other changes They cannot pull updates from GitHub because Git doesn\'t want to overwrite their