GIT 错误 On branch master Your branch is up to date with ‘origin/master‘. nothing to commit, working

南门欣怡
2023-12-01

错误解决

On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

我的理解:分支被意外删除

#先查看分支—应该会有一个 *master—不管他

git branch

#切到 master 分支,提示

Switched to branch 'master'
Your branch is up to date with 'origin/master'.

#直接切换到 ‘origin/master’ 分支

#更新,推送一套走完

#检测分支‘git branch‘,有如下提示就,按部就班

* (HEAD detached at origin/master)
  master

#继续执行

git merge   #如果显示有  origin/master 就  git merge origin/master

重新提交

git add .
git commit -m "related_message"
git push origin master

切换到 master 分支

git merge master

可以删除 origin/master 分支

git merge -D origin/master
 类似资料: