Home > Software design >  Can not see the commits for pushing in Pycharm
Can not see the commits for pushing in Pycharm

Time:12-01

enter image description here

I've made some commits but I can not see them for the push.

I've read this may be related to not having a remote? But here is the result of the command line:

$ git remote
origin 

UPDATE:

git status command result:

git status
HEAD detached from 5235085
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    .idea/
    Connect4Py/__pycache__/

nothing added to commit but untracked files present (use "git add" to track)

git branch -avv command result:

git branch -avv
* (HEAD detached from 5235085) 908eb97 Fix: - New camera OpenCV configurations      - Improved the Yellow and Red Ball detections.      - Improved the Matrix placement of the balls.
  main                         6dc0b73 [origin/main] Fix: bug fixes
  temp                         1e084c0 Fix: - New camera OpenCV configurations      - Improved the Yellow and Red Ball detections.      - Improved the Matrix placement of the balls.
  remotes/origin/HEAD          -> origin/main
  remotes/origin/main          6dc0b73 Fix: bug fixes

Note: The fix: bug fixes commit was not made by me, that was another user and his commit-push commands were successful.

CodePudding user response:

Still in command-line, check the output if git status

If you are in detached HEAD mode (not in a branch), check your local and remote branches (git branch -avv), and see which one you should be on.
You can then switch to the right branch, and merge your detached HEAD.

git switch -c tmp
git switch main
git merge tmp
git branch -d tmp

For older Git:

git checkout -b tmp
git checkout main
git merge tmp
git branch -d tmp

From there, you will be able to push, including from PyCharm.

  • Related