git pull origin branch
remote: Counting objects: 23024, done.
<edits>
git add .
git commit -m "test1"
git push origin branch
用户B
git pull origin branch
remote: Counting objects: 23025, done.
<edits>
git add .
git commit -m "test1"
git push origin branch
用户A
git pull origin branch
remote: Counting objects: 250, done.
<edits>
git add .
git commit -m "test1"
git push origin branch
此时UserB上拉,git再次下载远程存储库中的所有对象 用户B
git pull origin branch
remote: Counting objects: 24125, done.
Receiving objects: 100% (24125/24125), 1007.93 MiB | 1.17 MiB/s, done.
Resolving deltas: 100% (15457/15457), done.
Checking connectivity... done.
Checking out files: 100% (5307/5307), done.
答案 0 :(得分:0)
它不是随机的 它是如何git工作的。
当你向git(git commit
)添加代码时,它将在下次下载。
用户A
# Download latest version
git pull origin branch
<edits>
git add .
git commit -m "test1"
# New changes are send to server
git push origin branch
用户B
# Download all changes user A added to git
git pull origin branch
<edits>
git add .
git commit -m "test1"
# Push new changes to server
git push origin branch
注意 :此时用户A还没有进行这些更改,他会在下次拉动时抓住它们。
用户A
# Now user A gets the updates form the server
git pull origin branch
<edits>
git add .
git commit -m "test1"
# Again - send updates to the server
git push origin branch
此时UserB上拉,git再次重新下载远程存储库中的所有对象
如上所述 - 用户A向远程仓库添加了新内容,但尚未在用户B存储库中找到,因为下一次拉动将再次下载内容(仅限上次拉动的增量)