开发者

How to push with TortoiseGit

In push following errors occured

git.exe push    "origin" master:master

To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'non-fast forward'
section of 'git push --help' for detail开发者_如何转开发s.
To //oht-fsv1/Source/Git/Test
! [rejected]        master -> master (non-fast forward)

What's wrong?


From git push:

When an update changes a branch (or more in general, a ref) that used to point at commit A to point at another commit B, it is called a fast-forward update if and only if B is a descendant of A.

In a fast-forward update from A to B, the set of commits that the original commit A built on top of is a subset of the commits the new commit B builds on top of. Hence, it does not lose any history.

In contrast, a non-fast-forward update will lose history.

So this will prevent you to lose history: try a git pull first, resolve potential conflicts, and "git push" the result.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜