Skip to content

Instantly share code, notes, and snippets.

@jonathanschilling
Created October 3, 2023 10:29
Show Gist options
  • Save jonathanschilling/ae8f5545ed923a4252d8a6623145ed11 to your computer and use it in GitHub Desktop.
Save jonathanschilling/ae8f5545ed923a4252d8a6623145ed11 to your computer and use it in GitHub Desktop.
Make Git fetch all remote branches
#!/bin/bash
# Make Git fetch all remote branches.
# from https://stackoverflow.com/a/25941875
git config --get remote.origin.fetch
# +refs/heads/master:refs/remotes/origin/master
# --> only fetches master !!!
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git config --get remote.origin.fetch
# +refs/heads/*:refs/remotes/origin/*
# --> now fetches all branches !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment