- Git Essentials(Second Edition)
- Ferdinando Santacroce
- 279字
- 2021-07-02 15:27:04
Setting up a new repository
The first step is to set up a new repository. A repository is a container for your entire project; every file or subfolder within it belongs to that repository, in a consistent manner. Physically, a repository is nothing other than a folder that contains a special .git folder, the folder where the magic happens.
Let's try to make our first repository. Choose a folder you like (for example, C:\Repos\MyFirstRepo), and type the git init command, as shown here:

As you can see, I slightly modified the default Git Bash prompt to better fit the need of the demoing commands; I removed the user and host, and added an incremental number to every command we type so that it will be simpler for me to refer to it while explaining, and for you to refer to it while reading.
Let's get back on topic. What just happened inside the MyFirstRepo folder? Git created a .git subfolder. The subfolder (normally hidden in Windows) contains some other files and folders, as shown in the next screenshot:

At this point in time, it is not important for us to understand what is inside this folder. The only thing you have to know is that you do not have to touch it, ever! If you delete it or if you modify the files inside by hand, you could get into trouble. Have I frightened you enough?
Now that we have a repository, we can start to put files inside it. Git can trace the history of any type of file, text-based or binary, small or large, with the same efficiency (more or less; large files are always a problem).
- Building Computer Vision Projects with OpenCV 4 and C++
- Voice Application Development for Android
- Access 2007數據庫應用上機指導與練習
- 區塊鏈通俗讀本
- 3D計算機視覺:原理、算法及應用
- 區塊鏈:看得見的信任
- 數亦有道:Python數據科學指南
- 數字媒體交互設計(初級):Web產品交互設計方法與案例
- 智能數據時代:企業大數據戰略與實戰
- 深入淺出 Hyperscan:高性能正則表達式算法原理與設計
- 云數據中心網絡與SDN:技術架構與實現
- 計算機組裝與維護(微課版)
- R Object-oriented Programming
- 區域云計算和大數據產業發展:浙江樣板
- SQL Server 2008寶典(第2版)