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
10
votes
1 answer

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

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 =…
gburri
  • 154
  • 1
  • 2
  • 9
10
votes
2 answers

How can I merge changes from an upstream branch to my fork's branch

I want to pull changes from an upstream repo's branch. I have set the upstream repo using: git remote add upstream http://URL-of-master-repo.git and then I tried to pull the changes using git checkout my-local-branch git fetch upstream…
stdcerr
  • 13,725
  • 25
  • 71
  • 128
10
votes
3 answers

Are "git fetch --tags --force" and "git pull " conmutative operations?

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…
yucer
  • 4,431
  • 3
  • 34
  • 42
10
votes
1 answer

Git fetch/pull have stopped working

Git fetch and pull both stopped working yesterday on the server (AWS instance). $ git fetch ERROR: Repository not found. fatal: The remote end hung up unexpectedly There are two repository clones on that instance, both giving the same error. git…
egor83
  • 1,199
  • 1
  • 13
  • 26
10
votes
1 answer

How to nest git repositories; fetch and merge

So I have two git repos. The first is our framework (think db abstraction, functions) and then another git repo for our new project. I want to include the framework git repo into the project git, and according to GitHub Help, this should work: cd…
Justin
  • 42,716
  • 77
  • 201
  • 296
9
votes
3 answers

Strange behavior with git fetch

I'm getting a big problem with GIT fetch...look this $ git fetch From server:project 422b4cb..a04c062 master -> origin/master $ git show-ref ba113be885e66a5306d1646cd3db0801170c04f8…
Miletos
  • 231
  • 1
  • 7
9
votes
3 answers

How git-pull corporate with git-fetch (was: what does git-pull option `-p` mean)?

Sometimes I see at articles command: git pull -p But I do not found info about that in official documentation What does that option mean? UPD As noted by @torek the -p option is passed to git fetch. And -p here means: -p --prune Before…
Eugen Konkov
  • 22,193
  • 17
  • 108
  • 158
9
votes
2 answers

Fetch specific commit from remote git repo

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…
cvrebert
  • 9,075
  • 2
  • 38
  • 49
8
votes
2 answers

Git Branches NOT Showing in "git branch" after Pull or Fetch but "git checkout" works ...?

After committing my latest work on a new branch branchname to my local git repo on machine A, I pushed that work to my gitlab remote repo with $ git push origin branchname The master branch was already in sync with the remote repo. All branches…
Thom Ives
  • 3,642
  • 3
  • 30
  • 29
8
votes
2 answers

How to control the order of fetching when fetching all remotes by git fetch --all

I have a lot of remotes added in my git. Each remote is a link to a network share folder of different regions, and each remote contains the code submitted by one developer. Everyday I need to fetch the latest code they submitted by git fetch…
palazzo train
  • 3,229
  • 1
  • 19
  • 40
8
votes
1 answer

Why include `master` in the command `git fetch upstream master`?

In the section Pulling in upstream changes on help.github's Forking a project it states: Some time has passed, the upstream repo has changed and you want to update your fork before you submit a new patch. There are two ways to do this: $ git fetch…
Matthew Rankin
  • 457,139
  • 39
  • 126
  • 163
7
votes
2 answers

What's the difference between "git fetch " and "git add remote upstream " followed by "git fetch upstream"?

I was trying to pull changes from upstream into my fork. I tried git fetch https://github.com/someuser/someproject, but it stubbornly refused to do anything. It just said something totally cryptic and did nothing, namely: From…
Roman Starkov
  • 59,298
  • 38
  • 251
  • 324
7
votes
1 answer

How do I fetch/pull multiple branches matching a wildcard string?

Goal: I have several repositories that are managed by the same rules. I would like to create a git alias to help fetch and/or pull only the relevant branches without fetching information for lots of remote branches relating to work I do not care…
Jason L
  • 73
  • 1
  • 6
6
votes
2 answers

How to change the URL on a local repository from GitLab to GitHub?

I had a repository on GitLab which I also published on GitHub. As of now all the Git commands I am using are making changes on GitLab. However, I want those commits on GitHub. I tried the command: git remote set-url origin…
Marcelo BD
  • 229
  • 3
  • 8
6
votes
1 answer

Git: Track branch without checking out?

So, I know you can pull a branch without checking it out by: git fetch origin branchname:branchname Is there way to also track that branch without checking it out? (Normally, this is accomplished by: git checkout --track origin/branchname or git…
PenumbraBrah
  • 181
  • 1
  • 8