girliemac / a-picture-is-worth-a-1000-words

I am trying to describe complex matters in simple doodles!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Git Push example needs correction

GollyTicker opened this issue · comments

Thanks for creating the nice pictures. I have looked at them and they're helpful - except for one case, where I'm sure that the information is incorrect.

Considering this explanation for git push
img

I see, that the left example does not fit with my experience and understanding of Git - and reproducing the setup with a small repository I get push rejected for the final git push -u origin tabby instead of a successful push.

This makes sense, because the tabby branch has different histories locally vs. remote. Locally, tabby has cat -> cat with bow tie -> cat with bow tie and stripes. Remotely, before the push, origin/tabby is cat -> cat with stripes. The last cat with stripes commit never existed locally, hence the push will not work. Merges are only possible locally and not on remote.

Do be correct, the lower drawing needs to:

  • have the was origin/tabby text point to cat with bow tie
  • draw a line from cat with bow tie to the new cat with bow tie and stripes
  • remove the cat with stripes entirely and all of it's lines

What do you think?

@girliemac What do you think about this?

@girliemac Hi. Since the explanations are popular I think it's important that they are also correct. Could you please respond to this issue? 😊

@GollyTicker Thank you so much and apologies for not seeing your comments sooner.
I oversimplified the diagram by not explaining the local state on the particular drawing. It has been years since I originally created it so I do not 100% remember precisely what I was trying to achieve at that time. But, I think this one was made as a sequel of the merge and rebase doodles, so you are right, it doesn't make sense if somebody only sees this doodle without the previous ones.

I need to somehow edit this physical drawing on paper without making it messy!

Thank you for pointing this out 😺

Theoretically you could edit the image via Photoshop and co. Otherwise I'd would make most sense to redraw these pictures.