
我做了一些提交,但我看不到它們的推送。
我讀過這可能與沒有遙控器有關?但這是命令列的結果:
$ git remote
origin
更新:
git status命令結果:
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命令結果:
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
注意:fix: bug fixes提交不是我做的,那是另一個用戶,他的 commit-push 命令成功了。
uj5u.com熱心網友回復:
仍然在命令列中,檢查輸出是否 git status
如果您處于分離的 HEAD 模式(不在分支中),請檢查您的本地和遠程分支 ( git branch -avv),并查看您應該在哪個分支上。
然后您可以切換到正確的分支,并合并您分離的 HEAD。
git switch -c tmp
git switch main
git merge tmp
git branch -d tmp
對于較舊的 Git:
git checkout -b tmp
git checkout main
git merge tmp
git branch -d tmp
從那里,您將能夠推送,包括從 PyCharm 推送。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/372630.html
