Git is an open source distributed version control system that can efficiently and efficiently handle project versioning from very small to very large. Allows developers to clone (git clone), copy a full git repository on the local machine, or commit the code to a git server.
First, the environment
VMware creates an Ubuntu virtual machine as a git server, and the client is built under Windows system.
Second, Ubuntu build git server
1, Installation OpenSSH
Command: sudo apt-get install Openssh-server
2. After the installation is complete, check that the SSH service is started
Command: Ps-e|grep SSH
3. Create git user to manage running git service
Command: Useradd git/adduser git
Note: The Useradd command does not create a user folder in the/home directory, and AddUser creates
4. Install git
Command: sudo apt-get install Git-core
Note: sudo execution will error
Workaround: Go to root (su), add write permission to the file (chmod u+w/etc/sudoers), edit the/etc/sudoers file (vi/etc/sudoers, add git all= (All), and then save the exit.
5. Initialize the server-side git repository
Command: Git init--bare/home/git/myrep.git
Third, Windows build git client
1, go to git website download (default option to install)
Https://git-scm.com/downloads
2, after the installation is complete, right-click on the desktop will appear "Git GUI here" and "Git bash here" or in the Start menu has git shortcut, click Git bash here, the command box appears
】
3. Configure password-free SSH login on Windows client
Command: ssh-keygen-t RSA
Generate the key under the Windons user under the/.ssh folder
Copy the generated public key id_rsa.pub to the Ubuntu server
Create the. ssh folder on the Ubuntu server and enter the directory to create the Authorized_keys file, append the public key content to this file after creation is complete
Command: mkdir. SSH
Touch Authorized_keys
Cat Id_rsa.pub >>/home/git/.ssh/authorized_keys
Iv. Testing
On windons, open git bash and enter the command to clone (Ubuntu Service Area ip:192.168.1.102) (Empty project)
Command: Git clone [Email protected]:/home/git/myrep.git
And then on the desktop you'll find the clone down directory
Since this simple GIT version control server has been built, the following bloggers will continue to update the more detailed information about GIT!!!
Git version control Ubuntu build git server