Generally, the hosted code on GitHub is public. Anyone can view, copy, and download the code. Private Projects are charged. Therefore, you can build a git service for your own use.
First install git:
Sudo apt-Get install git
After installation, createBareWarehouse
Git init -- bare # create a raw git Repository
Note: DifferencesGit initAndGit init -- bareDifferences:
Git init is used to create a repository to store the project source code. After git init, The. Git folder and project source code will appear in this directory in the future.
The effect of git init -- bare is similar to that of git init, but only the. Git folder will be stored to keep the change information, without the project source code.
The biggest difference between them is:
Git init-the bare repository created by bare can be operated by many people, while git init allows users to play locally.
That is to say: git init -- bare is used on the GIT server, while git init is used on the local machine of the user. There is a warehouse created with bare on the server, which is mainly used to connect, synchronize, coordinate, and record the small warehouse on individual computers without storing the project source code. Each developer has a small warehouse on his/her own computer to store the project source code and make changes.
Build a git remote repository (that is, the GIT server, no need to connect to GitHub again)