Questions tagged [git-fetch]

git-fetch - Download objects and refs from another repository

The git command fetch retrieves changes done in a remote repository.

It will not merge the changes automatically into your local branches, use git pull for this or merge from the origin-branch after doing fetch.

See the man page for full details.

397 questions
6
votes
1 answer

Will Git ever clone, fetch, or push orphan commits?

Orphan commits are created when there is no tag or branch that contains them in its graph of parent commits. For example, if you make a branch foo, add commits a and b, then delete the branch (i.e. remove the reference foo from commit b), then both…
LightCC
  • 9,804
  • 5
  • 52
  • 92
6
votes
1 answer

what is the difference between git pull , git fetch and git rebase?

What are the differences between git pull , git fetch and git rebase? I feel pull and fetch are same.
Lakmal Vithanage
  • 2,767
  • 7
  • 42
  • 58
6
votes
1 answer

Why doesn't git run a git fetch periodically?

Since git fetch doesn't make any changes and it just updates the references and keeps the tracking branches up to date with the remote branches (like it says if it's ahead and/or behind). I can see that it is really important to know whats going on…
user3571278
  • 721
  • 5
  • 15
6
votes
1 answer

How do I force fetching of tags if I have the --no-tags option set

Whenever I run git fetch it fetches all the tags from origin. In a project with lots of tags, this can get quite bothersome. So I ran git config remote.origin.tagopt --no-tags so fetching will no-longer fetch tags. However, there are some times when…
Douglas Meyer
  • 1,561
  • 12
  • 12
6
votes
2 answers

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

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] …
ShlomiTC
  • 446
  • 4
  • 12
6
votes
2 answers

git fetch fails due to pack-object failure

When I add our remote repository as upstream and try to fetch it , it fails as below : $ git fetch upstream remote: Counting objects: 11901, done. remote: aborting due to possible repository corruption on the remote side. error:…
nikel
  • 3,402
  • 11
  • 45
  • 71
6
votes
1 answer

How to git clone 'git' metadata only

I have a remote repo called FOO which has the two following revisions : commit1 commit2 I have a directory 'bar' which contains all the files for commit2 but I am missing the .git directory and all metadata. Is there a way for me to 'git clone'…
user3009900
  • 61
  • 1
  • 3
6
votes
3 answers

Fix Git "object not found" for good

From one pull to the next, every git pull on the server ends up in this: $ git pull remote: Counting objects: 53, done. remote: Compressing objects: 100% (32/32), done. remote: Total 32 (delta 19), reused 0 (delta 0) Unpacking objects: 100% (32/32),…
Lanbo
  • 15,118
  • 16
  • 70
  • 147
5
votes
1 answer

Git: What do the numbers reported by `git fetch` mean?

When running git fetch, that gives some numbers: $ git fetch upstream remote: Counting objects: 77, done. remote: Compressing objects: 100% (23/23), done. remote: Total 47 (delta 19), reused 39 (delta 11) Unpacking objects: 100% (47/47), done. From…
Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
5
votes
1 answer

Did git configuration `branch..fetch` ever exist?

Git configuration branch..fetch is mentioned in the first git-fetch example1: Update the remote-tracking branches: $ git fetch origin The above command copies all branches from the remote refs/heads/ namespace and stores them to the local…
muzimuzhi Z
  • 187
  • 10
5
votes
1 answer

Get only tags / references of a git remote repository

Is it possible to get the tags / references of a repository (eg GitHub) without downloading objects / files? My use case is in packaging the latest beta release of some software which has a long history and is therefore large to clone. Ideally after…
Tom Hale
  • 40,825
  • 36
  • 187
  • 242
5
votes
3 answers

What is the difference between checkout and cherry-pick?

I have fetched a particular bug fix from a remote repository. Now I have two options: git checkout FETCH_HEAD git cherry-pick FETCH_HEAD and I am not sure what is happening in both cases. I have tried the first version and it looks to me that in…
Roman
  • 124,451
  • 167
  • 349
  • 456
5
votes
2 answers

Update all local branches with all remote branches

How do I override all local branches with all remote branches? Here are my local branches: client-side-js-framework client-side-js-framework-2 client-side-js-framework-3 handlebars master And my remote…
Farid
  • 1,557
  • 2
  • 21
  • 35
5
votes
2 answers

Git Pull vs Git fetch Which one is Preferable?

I know the difference between git pull and git fetch . but i want to know, Which one is Preferable? because git pull doing merge automatically without my knowledge. thats the different i found. git fetch wont do that. is there anything else?
Mohideen bin Mohammed
  • 18,813
  • 10
  • 112
  • 118
5
votes
3 answers

git fetch with path instead of remote

I understand the idea of running git fetch , because the remote branches are then available with git checkout /. But how does it work if I just run git fetch path/to/other/repo How can I checkout the corresponding branches?…
Olivier Verdier
  • 46,998
  • 29
  • 98
  • 90