Alex Xu的动态

How does Git work?? ? To begin with, it's essential to identify where our code is stored. The common assumption is that there are only two locations - one on a remote server like Github and the other on our local machine. However, this isn't entirely accurate. Git maintains three local storages on our machine, which means that our code can be found in four places:? ? - Working directory: where we edit files? - Staging area: a temporary location where files are kept for the next commit? - Local repository: contains the code that has been committed? - Remote repository: the remote server that stores the code? ? Most Git commands primarily move files between these four locations.? ? Over to you: Do you know which storage location the "git tag" command operates on? This command can add annotations to a commit.? ? --? Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://bit.ly/3KCnWXq #systemdesign #coding #interviewtips? .

  • timeline
Abdelmonêm BEN NACEUR

Full Stack Developer (ReactJS/VueJS/NodeJS/Symfony)

1 个月

I would say it depends. If the git tag command is used through a platform like GitHub, it operates on the remote repository, and you'll need to fetch the tags afterward to reflect them in the local repository. However, if it's used on a local machine, it operates on the local repository.

Ayman Anaam

Dynamic Technology Leader | Innovator in .NET Development and Cloud Solutions

1 个月

This is a solid breakdown of Git’s structure! One thing to keep in mind is understanding how changes flow through these stages, as it helps avoid conflicts and ensures smoother version control. Use git stash when you need to temporarily save your work without committing, especially when switching branches to avoid losing progress!

Chandramouleeswaran Sankaran (Mouli)

Looking for talented faculty and students to join RV University, Bangalore.

1 个月

Wonderful visual representation!! Git pull, being a combination of git fetch and git merge, breaking the arrow of the git pull, at the local repo, would have shown that a copy is available at the local repo as well as in the working directory.

Alexander Uspenskiy, PhD

IT Director | AWS Certified Architect | Sr Engineering Manager | AI/ML | Ex-Levi Strauss & Co., Dell Technologies | 3 x Cloud Certified AWS, Azure | Agile expert (SAFe, CSM) | eCommerce, Web, Mobile Apps

1 个月

It is a bit more complicated in terms of merging/cherry-picking etc

Samet Celikcapa

Backend Developer, ?o?unlukla Python'la ama .NET de biliyor

1 个月

Hi Alex Xu It would be great if you share some graphics about how Git controls Line Breaks (LF-CRLF) for different platforms (especially between Windows and Linux) Nowadays I have faced a problem related to this because of mounting local repo (Windows) to a container (Linux). But there isn’t enough visualized documentation about it. .gitattributes solved my issue but I still don’t understand the whole mechanism At which stage does Git change line breaks for text files? etc Some graphics would be very helpful

回复
Bilgin Ibryam

??Distributed systems architect, turned product manager??

1 个月

This is a great visual. But order is wrong. Should start from git clone and git checkout from the top. The rest ??

Dorival Querino

Helping Pro Java Devs with Microservices & AWS | AWS Certified | Book Writer | 16 Yrs in Java |DevOps| Agile | Test Automation| Coordinator @ TDC SP |

1 个月

These concepts about #Git brought by Alex Xu are gold! " - Working directory: where we edit files - Staging area: a temporary location where files are kept for the next commit - Local repository: contains the code that has been committed - Remote repository: the remote server that stores the code Most Git commands primarily move files between these four locations. " Tks for sharing!

John L?ng

Software Developer

1 个月

It has always confused me how the same thing can be accomplished with many different combinations of git verbs and flags

回复
Bao Tran

eternal coder

1 个月

what is diff between local repo and working directory like I'm on A branch then I git fetch to update the latest into my local repo, then my current directory also get the latest one, already. No need git merge

Dávid Katona

Co-Owner, CEO and CIO at E.R.T. Hungary Ltd., Director - IT Operations and Infrastructure at TerraCycle Ltd.

1 个月

I won't be popular with this comment, but anything that's somewhat of a how to for Git always makes me think of that gamer pun. "Git gud" :)

回复
查看更多评论

要查看或添加评论,请登录