$ ls README.md $ pwd /f/workspace/toplinker/gitlab/leon.li/dirty
A新建一个a.txt, push到远程。
1 2 3 4
$ echo a >> a.txt $ git add . $ git commit -m "a add txt" $ git push
然后B再新建一个b.txt, push到远程。
1 2 3 4 5 6 7 8 9 10 11 12
$ echo b >> b.txt $ git add . $ git commit -m "b add txt" $ git push To gitlab.topibd.net:leon.li/dirty.git ! [rejected] master -> master (fetch first) error: failed to push some refs to 'gitlab.topibd.net:leon.li/dirty.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards'in'git push --help'for details.