【Git】解决On branch master Your branch is ahead of ‘origin/master‘ by 1 commit. (use “git push“ to pu

idea中版本控制出现这样的问题:
On branch master
Your branch is ahead of ‘origin/master’ by 1 commit.
(use “git push” to publish your local commits)
Changes not staged for commit:
(use “git add …” to update what will be committed)
(use “git restore …” to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
或者在gitee上看到文件显示为文件名 + @ + 随机性的字母或数字
【Git】解决On branch master Your branch is ahead of ‘origin/master‘ by 1 commit. (use “git push“ to pu_第1张图片
原因可能是你要提交的这个文件夹里面有另一个.git文件,
需要先删除这个子文件夹里的.git,bash中使用以下命令或者手动删除

rm -r .git

第二步,清理本地git缓存

git rm -r --cached .

第三步,重新上传到本地仓库,再提交到gitee

git add .
git commit -m "修改代码"
git push 

参考博客

git出现文件夹后面跟@+数字

你可能感兴趣的:(Git版本控制,git)