Implementing Git in LAN under windows

In a certain company of China Electric Power Technology Co., Ltd., after two days of work, I was completely exhausted. Because the internal network built by the switch was not connected to the external network, the four of us set the IP to 192.168.1.2-5; then we needed to install git and tortoiseGit, which is actually It can be achieved by using a shared folder, and then I spent a long time using ip to access according to ssh, but it didn't work. Finally, I used this post to solve the problem, and I really felt tired.

Implementing Git in LAN under windows

hjzgg 2016-04-28 17:46:26 Browse 6536 Comments 0
Summary: 1. First create a folder on host A to store the repository you want to expose. Then enter this folder, right-click -> Git create repository here, and check Make it Bare in the pop-up window! After that, share this folder completely (share it, right? Note that the permissions should be set to "full control" for the user who uses this folder).
1. First create a folder on host A to store the repository you want to expose . Then enter this folder, right-click -> Git create repository here, and check Make it Bare in the pop-up window! After that, share this folder completely (share it, right? Note that the permissions should be set to "full control" for the user who uses this folder). Folder sharing process is as follows: Right click on the folder - Properties - Sharing - Advanced Sharing - Share this Folder - Permissions - Full Control.

 

 

 

 You can see that there is a shared network path

 2. Then clone the git repository just created elsewhere on host A

3. After clone, add a new file in the same directory of .git

4. Push the new file to the git repository (execute the add, commit, push commands in sequence)
Note: URL corresponding to Remote: If the destination git repository is on the local host, the URL is the location of the folder where the destination git repository is located; otherwise, the URL is the network share path.

 
 5. 注意了,现在换成了同一个局域网的主机B ,然后利用主机A上git仓库所在共享文件夹的网络路径进行clone

 可见,我们同时得到了主机A中新添加的文件

6.主机B上,接着操作,添加另一个新的文件lxkdd.txt,同样push到主机A的git仓库上(分别执行add, commit, push命令)

7. 注意了,现在换成了主机A了 ,为了得到主机B新添加的文件lxkdd.txt,执行pull命令

 显而易见,看到了新添加进了的lxkdd.txt文件




Guess you like

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