Questions tagged [git-fetch]

git-fetch - Download objects and refs from another repository

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

Git Bash upgraded to v2.41, but now the very basic command `git fetch` is not working

After GitBash has been upgraded to v2.41.x in Windows 11 64bit, some basic commands like git fetch have apparently stopped working. Now, if I run any of fetch command derivatives like git fetch/git ...
Vicky Dev's user avatar
  • 1,893
0 votes
1 answer
34 views

Fetch refs not associated with a branch

I have a program that runs some scientific tests. I have written a git post-receive hook for the server that runs these tests: When it receives a commit, e.g. deadbeef..., run the program Commit the ...
Zaz's user avatar
  • 46.6k
-1 votes
1 answer
34 views

How to solve conflicts while pulling a branch from a remote repository?

I am currently working on a project that involves forking a specific GitHub repository. In my forked version, I am required to incorporate a branch named windows into my project. The original main ...
Straw User's user avatar
0 votes
1 answer
47 views

Git cannot checkout remote branch despite `git ls-remote origin` showing it exists

I'm struggling to checkout a remote branch that I know it exists, because it show up with git ls-remote: $ git ls-remote 242d56fbd8d8af67df3157bd047252f5580e3df8 HEAD ...
Cornelius Roemer's user avatar
-1 votes
3 answers
226 views

Why does actions/checkout fetch the latest commit right after cloning the repository?

While trying to make sense of the action actions/checkout@version, I came across this answer in which the following was stated to explain what happens when the same action is executed: The default ...
Mehdi Charife's user avatar
1 vote
1 answer
30 views

How to merge large number of changes info common repo?

There are two developers working on branches dev1 and dev2, respectively, and usually every time one of them commits a change they do a PR into a common dev branch. Both developers have made a bunch ...
gkeenley's user avatar
  • 6,116
0 votes
0 answers
18 views

How can I fetch only a new remote branch with intellij

I want to fetch a single remote branch that exists on the remote and not on my local machine instead of fetching the entire repository. Basically, the equivalent of git fetch <remote> <branch-...
BrunoElo's user avatar
  • 358
-3 votes
1 answer
114 views

How do I set git fetch --force in git config?

I want every fetch and pull to get tags from origin, replacing local ones if they differ, and delete tags and origin/ branches that are not on origin, so I did this: git config --global fetch.tags ...
H.v.M.'s user avatar
  • 1,402
0 votes
0 answers
17 views

Problem with merging feature branch on develop branch

I have questions about git merging. I'm a student, and currently working on a project with four colleagues. So, I tried to merge my feature branch on develop branch, and got some conflicts that i didn'...
Moonlight's user avatar
0 votes
1 answer
109 views

git remove single line from file in git history

I accidentally committed a line of code that was not meant to be part of the commit. class Engine { x: X protected _events: Event // <-- this line was accidentally included y: Y the ...
Michael Moreno's user avatar
0 votes
0 answers
35 views

Git not recognizing recently added submodule

In my project, I have two submodules. One added in the last commit (subA) and one added after the last commit (subB). I have verified in .gitmodules, .git/modules/, .git/config. In all three places, ...
Sourav Kannantha B's user avatar
0 votes
0 answers
38 views

Git fetch on master breaks

I am trying to run below command after shallow clone. //Run first - Passes git fetch --depth 100 --update-head-ok origin master:remotes/origin/master // Run next - Fails git fetch --depth 100 --...
Hacker's user avatar
  • 7,818
5 votes
1 answer
86 views

Did git configuration `branch.<name>.fetch` ever exist?

Git configuration branch.<name>.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 ...
muzimuzhi Z's user avatar
1 vote
1 answer
197 views

`git submodule update` always keep fetching the same commit

I have a Git repo with one submodule and two commits that change the submodule's HEAD. If I check out one of the commits, and do a git submodule update, this succeeds without having to connect to a ...
Cactus's user avatar
  • 27.1k
0 votes
1 answer
69 views

Network failure during git fetch command

I'm trying to investigate what happens if the network would fail during a git fetch command. I can't find any documentation that really goes into detail of the fetch command and digging into the git C ...
Johan Ahlqvist's user avatar
1 vote
3 answers
62 views

Why does this person (see link to article) use checkout to create a feature branch from the development branch and not fetch?

I thought you had to use fetch to get the latest version of a branch from the remote repository. If you do this as the person who wrote the article, don't you create a new feature branch from the &...
Jens's user avatar
  • 141
0 votes
2 answers
72 views

How do I make `origin/HEAD` work with partial fetch settings?

In a typical "regular" git clone, one ends up with .git/config as follows: [remote "origin"] url = [email protected]:orgname/reponame.git fetch = +refs/heads/*:refs/remotes/...
jakub.g's user avatar
  • 38.7k
1 vote
0 answers
87 views

How can I grab specific SHA-1 hashes from remote repositories?

This script iterates multiple Git repositories in order to get their latest commit SHA-1 per branch. These commands are launched inside an arbitrary .git directory, so Git commands can be invoked ...
Sovenique's user avatar
0 votes
0 answers
37 views

git fetch overwrote the current main with an old push to another remote, how to get my main back to how it is on github?

I wanted to get the tags that another contributor added to a github remote, so I ran git fetch --all --tags. The resulting fetch looked like this: $ git fetch --all --tags Fetching origin remote: ...
sigil's user avatar
  • 9,370
1 vote
1 answer
202 views

Can I set in Jenkins to not fetch every file from gitHUB?

I have a project on gitHUB where I have two '.txt' file at .project level. I would use them for comparison a previus run to a new run to find out the difference. I use Jenkins to build the project, ...
Péter Sánta's user avatar
0 votes
2 answers
735 views

Git pull shows "already up to date" but they're wrong

DISCLAIMER : There's already a post that already addresses this issue but sadly the author did not find any definite answer. Here's my issue : git pull shows "already-up-to-date" but they're ...
Zel's user avatar
  • 19
0 votes
0 answers
12 views

Is there a way to fetch individual subdirectories instead of entire git repo? [duplicate]

I'm working on a project where I would like to work on separate subdirectory without fetching the entire repo. As an example, project_repo has the structure: project_repo/ mainProgram/ pluginA/ ...
Nova67's user avatar
  • 1
0 votes
3 answers
429 views

Git push asks to fetch and merge but there is nothing to fethc or merge

I have been trying to get familiar with Git, new to programming. However, every time I seem to want to push git "git push origin main", I get an error saying my local and remote branches ...
Dan's user avatar
  • 25
0 votes
1 answer
138 views

Running <git worktree add> checks out older commit hash

Im running a jenkins pipeline, where: [Pipeline] { (Prepare) [Pipeline] sh + git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' [Pipeline] sh + git fetch origin master From https://...
csaba's user avatar
  • 75
0 votes
1 answer
61 views

sharing a git repository to a machine that does not have internet access from one that has

I have this setup machineA -> remote server with a repo.git initialized with --bare machineB -> client that can access to internet and clone repo.git, so it locally will have repo machineC -&...
zerunio's user avatar
  • 13
2 votes
1 answer
357 views

How can I make `git fetch --all` fail/show me failures prominently, if any of the remotes fail?

My issue is that I have multiple remotes set up, but day to day I only push to one. Let's call this remote 'Frank'. The other one, I almost never pull from, lets call her 'Alex'. The 'Alex' remote is ...
AncientSwordRage's user avatar
0 votes
1 answer
636 views

Why does git require me to commit or stash local changes before doing a pull

I made a change to a file in my local working copy and the same file has been modified in the remote repo. When I do a git pull, git gives the message, "error: Your local changes to the following ...
racerX's user avatar
  • 930
0 votes
0 answers
736 views

Getting Permission denied when doing Git Pull

I am getting the following error when doing git pull: $ git pull remote: Azure Repos remote: Found 281 objects to send. (30 ms) Receiving objects: 100% (281/281), 49.09 KiB | 12.27 MiB/s, done. ...
Pedro Morales's user avatar
0 votes
1 answer
641 views

Unable to find remote git branch in remote -- BitBucket

Switched to a new machine. I need to pull the working branches which was pushed from my old machine to remote. But I am unable to find the remote branches via git command. I could see the branch in ...
user avatar
0 votes
1 answer
34 views

Git connect a new branch remotely

I have a similar situation to the one seen in the image in my project. Let's consider the case that a colleague creates a new branch already pushed, which has no commit linked to the test branch. So ...
Paul's user avatar
  • 3,714
2 votes
1 answer
2k views

GIT: How do I properly download a remote branch to local?

Want to download another remote branch to make maintenace, then push back. so I tried: git switch another_branch fatal: invalid reference: another_branch tried: git checkout --track origin/...
Chiron's user avatar
  • 974
1 vote
0 answers
314 views

Configure git to always fetch only current branch and master

Is it possible to configure git to, by default, when using git fetch, fetch only the current branch and master from the remote, without explicitly mentioning the current branch name? I know that I can ...
Klas Mellbourn's user avatar
1 vote
1 answer
2k views

Fetch not found on Ubuntu 20.4

i am trying to use the breakpad, but got stuck at fetch cant be found.. i am trying to install fetch from Ubuntu repositories, but there also fetch is not available. Any suggestions. Version ...
Spartacus's user avatar
0 votes
0 answers
169 views

How to write bash script to loop through a git fetch command

I've been trying to fetch all branches of a git repository using "git fetch" but due to network issue it's failing Then after searching for a while I tried "git fetch --depth=n" , ...
xxx yyy's user avatar
-1 votes
1 answer
43 views

Exchange changes in Git on two different windows PC

We have a team of 5 people and we can git setup on each PC. Now let's say Tester1 reports some bug and Dev1 fixes that bug. Now, Dev1 doesn't want to push that change to the centralized system without ...
Jayesh_Joshi's user avatar
2 votes
1 answer
19k views

Source branch is two commits behind the target branch

In IntelliJ I was working on a new branch from a remote branch called stage. My branch was called PM-43655-stage. I committed my changes and did git push -u origin PM-43655-stage. It created a merge ...
Aditya K's user avatar
  • 135
0 votes
1 answer
31 views

Problem with running `git merge` on my new branch

I have my work only on my master branch locally and remotely also I have an upstream from where I fetch updates and merge/push them to my master branch, the question is how should I properly execute ...
Riomare's user avatar
  • 65
0 votes
1 answer
196 views

Upload or fetch only changed Git file from central repository (GCP) to VM Server

We are having several client VMs that run some stuff based on config files we provide, and we store all our config files in ONE central repository in GCP. So Suppose, whenever we change ONE config ...
4nkitpatel's user avatar
1 vote
1 answer
579 views

Git fetch two branches with enough history to cover merge base?

For CI jobs that need to work on the diff on an MR, I would like to fetch the source branch and target branch with enough history to reliably run something like git diff main...mr (where main is the ...
aij's user avatar
  • 5,953
1 vote
0 answers
122 views

Where does git fetch from when doing a git submodule update?

The git submodule update documentation says: Update the registered submodules to match what the superproject expects by cloning missing submodules, fetching missing commits in submodules and updating ...
mic's user avatar
  • 821
1 vote
1 answer
163 views

git - fetching from a specific branch although repository wasn't cloned with '--single-branch'

To make a long story short, what I'm looking for is to be able to fetch only a specific branch in a local repository, even though this repository wasn't originally cloned with "--single-branch -...
ilani's user avatar
  • 55
0 votes
2 answers
137 views

Update local reference for remotes without pushing

I'm developing a team script for fetching & pulling and need to test fetching. How do I modify my local version of the remote reference (without pushing) so that a fetch command will update my ...
mlhDev's user avatar
  • 2,235
1 vote
1 answer
2k views

GitHub Desktop suddenly not fetching origin, can't push changes

We've run into a problem with one of our contributors using GitHub desktop. When they try to push their most recent changes the following error appears On branch main Your branch is up to date with '...
David Jones's user avatar
0 votes
4 answers
25k views

How to switch (or checkout) to a existing remote branch in Git without facing detached HEAD

At first when I clone the Git repository I am in the master branch. But I have already created a remote develop branch. I run git fetch origin develop. Then, I use git checkout develop and it ...
Mands's user avatar
  • 171
5 votes
3 answers
4k views

How to preview changes before git pull

I want to check the changes that will done to the files after I run git pull. I know we use git fetch to retrieve new objects from remote repository without changing local repository. But how can I ...
Paras Gupta's user avatar
3 votes
2 answers
141 views

Git merge from another branch - 3 different methods - will all work correctly?

I'm working on branch MyFeature, which was created based on branch Develop. From what I understand, there are (at least) 3 ways to merge Develop back to MyFeature, when I'm checked out on MyFeature: a....
Alonzzo2's user avatar
  • 979
10 votes
3 answers
11k views

Git gc and git prune warnings when git fetch origin is run

Working with remote repository at some moment I started recieving this when I run git fetch origin Auto packing the repository in background for optimum performance. See "git help gc" for ...
Dmitriy Metelya's user avatar
3 votes
2 answers
532 views

is there a way to delete the previous incomplete fetch and start it all over again?

I was fetching the chromium, using fetch chromium and unluckily my internet went off . So i pressed ctrl+c to end the fetching process then, assuming i could start it all over again later when ...
Avani Singh's user avatar
0 votes
1 answer
36 views

Remove only on Local any Remote branch no longer include in fetch

for example, I have the following Branches: main -> tracking origin/main feature/f1 -> tracking origin/feature/f1 feature/f2 -> tracking origin/feature/f2 and in .gitconfig [ remote "...
NexCastus's user avatar
0 votes
1 answer
338 views

Github: Remote does not appear to be a git repository

I'm having some trouble with Github throwing the error: fatal: 'remote' does not appear to be a git repository. I did the cloning, which was successful. git clone https://github.com/StephenW789/CIS-...
Stephen Wong's user avatar

1
2 3 4 5
8