git push -v

From wikieduonline
Jump to navigation Jump to search


git push -v
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>


How to commit to remote branch:

git push origin HEAD:your-name-of-remote-branch
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 8 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 5.48 KiB | 801.00 KiB/s, done.
Total 11 (delta 9), reused 0 (delta 0), pack-reused 0
remote:
remote: View merge request for your-name-of-remote-branch:
remote:   https://gitlab.com/your-project/your-app/-/merge_requests/2913
remote:
To gitlab.com:your-project/your-app.git
   7caef6a60..f942d7435  HEAD -> your-name-of-remote-branch

Error if you omit HEAD:

git push origin name-of-remote-branch
error: src refspec name-of-remote-branch does not match any
error: failed to push some refs to 'gitlab.com:project/app.git'


git status
HEAD detached from origin/your-branch-name
nothing to commit, working tree clean


Related

See also

Advertising: