[1095] Git working flow
Ref: How does Git work? Git Tutorial for Beginners
Ref: Git summary: how to use basic git commands
- Workspace: it’s the place where you see in your computer system, or the directory where you check out your files. Files in the workspace could be added to the Git by using
git add
command. Basically it could be any folders in your computer. - Index: it’s also called stating area. It’s an invisible space where you can add files that you want to commit. To add commit, you can use
git commit
command. - Local repository: it’s also an invisible repository. Actually it’s stored in the .git folder, which is hidden in the folder you created.
- Remote repository: this could be another computer, or it could be the server of others, such as Github, which we can consider it as a remote repository. To access to the remote repository, git push or
git pull
could be used.
In addition, we also need to be familiar with some other common concepts in Git
.
- Branch: it’s used to create another line of code. Usually it’s for creating another new feature. Once the new feature has completed, it can be merged back the the master branch.
- Master Branch: we can consider it as the main branch/code to work on. You can add other branches if needed. But the whole project can only have one master branch.
- Commit: it holds the current state of the repository. It can be considered as a node of a linked-list. Every commit has a pointer to the parent commit object. You can go back to the parent commit object by changing the pointer.
- HEAD: it is the pointer to the most recent commit on the current branch. It’s actually a hash value of current commit, which is calculated by SHA-1 hash on a file with a hash value of 160 bits that uniquely identifies the contents of the file.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
2023-01-16 【801】Python绘制机器学习特征相关性热力图