Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fails to verify if branch exists or not & then fails to push because branch exists on remote. #42

@TheBlackPlague

Description

@TheBlackPlague

Environment: This is run inside a docker container.

It seems the action fails to verify if a branch exists or not:

/usr/bin/git fetch
/usr/bin/git rev-parse --verify project-tree
fatal: Needed a single revision
Branch project-tree does not yet exist, creating project-tree.
/usr/bin/git checkout -b project-tree
Switched to a new branch 'project-tree'

In the above case, it says that project-tree doesn't exist, when it exists on remote. Furthermore, this matters because it later fails to push as the branch already exists on remote and the local history isn't updated:

[project-tree REDACTED] Update Project Tree (REDACTED).
   1 file changed, 1 insertion(+)
   create mode 100644 diagram.svg
  /usr/bin/git push --set-upstream origin project-tree
  To REDACTED
   ! [rejected]        project-tree -> project-tree (non-fast-forward)
  error: failed to push some refs to 'REDACTED'
  hint: Updates were rejected because the tip of your current branch is behind
  hint: its remote counterpart. Integrate the remote changes (e.g.
  hint: 'git pull ...') before pushing again.
  hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions