Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"fetch-depth: 0" doesn't fetch all branches #1017

Closed
vitalyk-multinarity opened this issue Nov 20, 2022 · 6 comments
Closed

"fetch-depth: 0" doesn't fetch all branches #1017

vitalyk-multinarity opened this issue Nov 20, 2022 · 6 comments

Comments

@vitalyk-multinarity
Copy link

I'm using the following snipped for checkout:

- name: checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

but when I run 'git branch ' later I see just one branch.
Please suggest,
Thanks,
Vitaly

@chachako
Copy link

same problem

@edannenberg
Copy link

It does fetch all branch data from the remote but doesn't configure any of them locally except the current branch. If you need some other branch you can do so after the checkout action like so:

- name: Setup master branch locally without switching current branch
  run: git fetch origin master:master

@marc-hb
Copy link

marc-hb commented Dec 9, 2022

but when I run 'git branch ' later I see just one branch.

That's because git branch shows local branches only. If you run git branch -a you will see remote branches too.

See also https://github.com/actions/checkout#checkout-a-different-branch

@vanZeben
Copy link
Contributor

Hey @vitalyk-multinarity, thank you for your issue :)

I think both @edannenberg and @marc-hb have addressed this issue succinctly (Thank you both for that 🙏🏻), so I'm going to close this issue. If you need more assistance, or there is something that's been missed, please reopen this issue and we can take a look at it :)

@vanZeben vanZeben closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2022
gberche-orange added a commit to orange-cloudfoundry/k3s-packages-boshrelease that referenced this issue Jan 5, 2024
gberche-orange added a commit to orange-cloudfoundry/k3s-packages-boshrelease that referenced this issue Jan 5, 2024
@jarofgreen
Copy link

@marc-hb
Copy link

marc-hb commented Jan 29, 2025

I totally forgot I ever commented on this issue...

Here's a very funny, cosmic timing coincidence: if you are one of the 2.5 people interested in such topics and subscribed to this issue, you may be interested in this unexpected git 2.48 "regression" and git describe fix I just submitted yesterday:

(it's NOT related to this GH action, sorry for the "noise")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants