开发者

Does the origin keeps all commits history, when working from multiple sources?

开发者 https://www.devze.com 2023-01-29 06:01 出处:网络
I use git for a few months now. I have a bare repository on a server, and I work with it from 2 locations.

I use git for a few months now.

I have a bare repository on a server, and I work with it from 2 locations.

I've noticed that when I do some local commits on one of the computers, push them on the server, and pull and merge them on the second location, I only get one new commit in the history.

If I've understood correctly, this is the way merge wor开发者_Python百科ks, and if I want the same histories between the two computers, I should use rebase, am I correct?

But the first question I wondered is: even if I don't have all the commits history on both computers, does the bare repository have it at least?

If yes, is it possible to consult the log on the remote server?

Thanks in advance

Mike


No history was lost.

The merge commits have 2 parent commits, the preceding local commit (which is what git log is showing you), and the remote commit that it was merged with. You can use gitk to visualize this.

Both systems, and the server, share identical history.

0

精彩评论

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

关注公众号