Using git on Ubuntu

Introduce the git building process:
1. Update apt-get
sudo apt-get update
2. Install Git (some versions are installed by default)
sudo apt-get install git
Then when asked, enter "y" and press Enter 
3. Create git management Administrator account
sudo adduser git
Then enter the password of this user and confirm the password again, the rest of the options are all defaults by pressing Enter 
4. Create a warehouse
Enter the srv folder and select the "Open in Terminal" option in the right-click menu to initialize the warehouse
sudo git init - -bare GitProject.git
(two - here) After the command ends, the following files will be created in MyProject.git 
In the srv directory, change the ownership of MyProject.git
sudo chown -R git:git MyProject.git So
far, a A local area network Git server with no permission restrictions has been set up.
5. Verify
Under home, start the command terminal, enter "sudo git clone [email protected]:/srv/GitProject.git", where the IP address is the ip address of Ubuntu and press Enter, and a message will appear under home The empty folder of GitProject.git 
6. Usually work under Windows, then use Windows to verify whether the server can be used. First install git, then install (all default) 
After that, right-click in a folder, select "Git Bash Here" and
enter "git clone [email protected]:/srv/GitProject.git" to enter "yes" 
and then use git commands to do files and programs. version managed

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326392026&siteId=291194637