fatal: You are not currently on a branch. To push the history leading to the current (detached HEAD)
See original GitHub issueI’ve already read https://github.com/actions/checkout/issues/124
I’m trying to push a commit during release but no success
fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, use
git push origin HEAD:<name-of-remote-branch>
python-publish.yml
looks like
name: Upload Python Package
on:
release:
types: [published, workflow_dispatch]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0 # probably don't need this
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Bump package version to ${{ github.ref_name }}
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
pip install bump2version==1.0.1
# Here we don't use ${{ github.ref_name }} since github action variables can't do sed/cut/slicing
# Remove leading 'v' from the tag name
bump2version --new-version ${GITHUB_REF_NAME#v} minor
# must supply either patch minor or major see https://github.com/c4urself/bump2version/issues/244
# but it's an ignored argument argument
git show
git push
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:7
Top Results From Across the Web
Git push master fatal: You are not currently on a branch
But when I try to push to master I get. fatal: You are not currently on a branch. To push the history leading...
Read more >Correcting detached head problems with Git - Acquia Docs
This detached head state occurs when a specific commit is checked out instead of a branch. You cannot commit to a commit—only to...
Read more >Recovering from the Git detached HEAD state - CircleCI
Not at all. It just means you are not currently attached to any branch, and as a result, your HEAD is detached. If...
Read more >git submodules - faq.sa
my_submodule$ git push fatal: You are not currently on a branch. To push the history leading to the current (detached HEAD) state now,...
Read more >What's a "detached HEAD" in Git? | Learn Version Control with ...
The HEAD pointer in Git determines your current working revision (and thereby the files that are placed in your project's working directory). Normally,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Bring it home
I was able to get it to work with v3:
If the commit should trigger workflows things get more complicated and a personal access token (PAT) is required:
Note that the fallback email address might not be correct if the user created the email address after July 18, 2017.^1
Note further that it is not possible to cancel the workflow, the only way to stop the current workflow and let it run again is via
exit 1
.^2