修改或添加了多个文件,但只想提交部分代码的正确方式:
git add demo.html // 提交到暂存区
git stash -u -k // 忽略其他修改,关键一步
git commit -m '修改演示文件' // 提交暂存区
git pull // 拉取合并
git push origin master // 推到远程仓库
git stash pop // 恢复之前忽略的文件(非常重要的一步)
修改或添加了多个文件,但只想提交部分代码的正确方式:
git add demo.html // 提交到暂存区
git stash -u -k // 忽略其他修改,关键一步
git commit -m '修改演示文件' // 提交暂存区
git pull // 拉取合并
git push origin master // 推到远程仓库
git stash pop // 恢复之前忽略的文件(非常重要的一步)