:git push origin master
To https://github.com/LLLUZHAO/Test.git
! [rejected] master -> master (non-fast-forward)
error: 推送一些引用到 'https://github.com/LLLUZHAO/Test.git' 失败
提示:更新被拒绝,因为您当前分支的最新提交落后于其对应的远程分支。
提示:再次推送前,先与远程变更合并(如 'git pull ...')。详见
提示:'git push --help' 中的 'Note about fast-forwards' 小节。
使用git push的时候出错了。
输入git fetch origin master:
:git fetch origin master
来自 https://github.com/LLLUZHAO/Test
* branch master -> FETCH_HEAD
查看一下分支:
:git branch -a
* master
remotes/origin/master
看看本地分支与远程分支的区别:
:git log -p master ..origin/master
commit 37d982b8e509976f0656a263a58205ccd58a0b99 (origin/master)
Author: zhao <[email protected]>
Date: Tue Mar 10 05:30:56 2020 +0800
update file name
diff --git a/11 b/11
new file mode 100644
index 0000000..d1f7637
--- /dev/null
+++ b/11
@@ -0,0 +1,2 @@
+lurongming
+zhaolu
合并:
:git merge origin/master
更新 2058905..37d982b
Fast-forward
11 | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 11
:ls
1 11 2 3
多了11文件。
可以选择强行覆盖,这样就以本地的为准:
:git push origin master -f