How can git achieve remote synchronization without using remote repositories such as GitHub?
Submit the code before work. After gOing hOme, sync the code to continue development and submission. The next day, the company will continue ......
Here is an experiment: using the directory synchronization function of the online storage, we create a "pseudo remote repository ".
Take Kingsoft disk as an example:
Step 1.
Find a local directory as a "remote repository". Suppose we use E: \ kuaipan \ Phalcon as the remote repository, then drag the Directory into the USB flash drive, right-click the directory in the client to enable synchronization.
Step 2.
Create a bare version library. According to git rules, only the bare version library can accept git push/pull requests. So we perform this operation (in the cygwin Virtual Environment ):
cd e:/kuaipan/phalcongit init --bare
Step 3.
Create a local version library. Assume that it is created in E:/workspace/phalcon_local.
cd e:/workspacegit clone e:/kuaipan/phalcon phalcon_local
Step 4.
Develop and submit
cd e:/workspace/phalcon_localtouch index.htmlgit add . && git commit -m "add index.html"git push e:/kuaipan/phalcon master
We created an index.html file in the worker work area and submitted it to the local repository (GIT commit). Then we pushed the local repository to the "remote repository" (GIT push ).
Step 5.
If we get home, we open the fast disk and synchronize the directory Phalcon in the fast disk to the local disk, which is equivalent to copying the remote database of the company. Assume that the directory is synchronized to D:/kuaipan/Phalcon.
Then go to the Workspace
cd d:/workspacegit clone d:/kuaipan/phalcon phalcon_localcd phalcon_local......git add . && git commit -m "---over---"git push d:/kuaipan/phalcon
We finished some work at home and finally pushed it to the remote warehouse. Some changes have taken place in the remote warehouse and will be automatically synchronized to the fast disk.
Step 6.
Go to the company the next day and repeat Step 5 for similar operations.
Git uses a network disk as a version repository for remote synchronization [to be verified]