After chopping hands, the fraud call came before the express delivery was received. How to improve the privacy and security of e-commerce>>>
question:
Error after executing git push command:
bogon:PPAutoPackageScript usrname$ git commit -m "add test.sh"
[detached HEAD da19d347] add test.sh
1 file changed, 4 insertions(+)
create mode 100755 xxxxWorkspace/xxxxAPP/PPAutoPackageScript/test.sh
bogon:PPAutoPackageScript usrname$ git push
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>
This error is literally not on a branch
Check it with the command git branch. It’s not true
bogon:PPAutoPackageScript usrname$ git branch
* (HEAD detached from bdcfe3d8)
solutions:
Through git checkout & lt; branchName> Switch to an existing branch
Note: before performing this step, if you have modified the file, remember to back up your modified content first. Otherwise, after switching branches, the effect is equivalent to a new git code, and your modification will be covered
bogon:PPAutoPackageScript usrname$ git checkout develop
Warning: you are leaving 1 commit behind, not connected to
any of your branches:
da19d347 add test.sh
If you want to keep it by creating a new branch, this may be a good time
to do so with:
git branch <new-branch-name> da19d347
Branch 'develop' set up to track remote branch 'develop' from 'origin'.
Switched to a new branch 'develop'
Check the branch of the local warehouse again, and you have switched to the development branch
bogon:PPAutoPackageScript usrname$ git branch
* develop
If you modify the file again, you can successfully push
Similar Posts:
- [Solved] Git switch branch error: error: Your local changes to the following files would be overwritten by checkout:
- Git pull does not specify an error message for the branch
- Git Unable to switch remote branches error: pathspec ‘origin/XXXX’ did not match any file(s) known to git
- How to Solve error: failed to push some refs to ‘xxxx’
- Git clone download code prompts that the file pointed to by head does not exist
- Git you are not allowed to push code to protected branches on this project?
- [Solved] error: failed to push some refs to ‘xxxx’
- How to Fix Git push warning: push.default is unset;
- You have not completed the merge: You have not concluded your merge (MERGE_HEAD exists)