In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Today, I would like to talk to you about what the collaborative operation of Git is, many people may not know much about it. In order to make you understand better, the editor summarized the following content for you. I hope you can get something according to this article.
Environment:
There is a my-project version library in the test_git directory
All commands are executed in the test_git directory
Local collaborative operation
Check out the code from the remote repository, or clone an existing version library
Copy an existing warehouse
# format: git clone object file git clone. / my-project. / my-project-copy
Transfer the new submission from the original library to the clone library
# 1. Modify the files in the original library and perform the add,commit operation git pull # 2. Execute git pull # 3 in the original library. Execute in the clone version library # now the code of the two version libraries is the same
Pull the modifications in the clone library to the original library
# 1. Modify the files in the clone library and perform the add,commit operation git pull # 2. Execute git pull.. / my-project-copy master # 3 in the clone version library. Execute in the clone version library and retrieve the modification # now the code of the two version libraries is the same
Because the clone library stores the information of the original library, it is possible to execute the pull command without parameters, but the original library does not have the information of the clone library, so the information of the clone library should be added to execute the pull command.
Pull: get the submission from other libraries
Submit and get code in a shared library
Submit the changed code to the shared version library for other repositories to pull
Git clone-- bare. / my-project # create a streaking warehouse # after execution, you will generate a shared library called our-project.git
# 1. The target warehouse modifies the file and performs the add commit operation # 2. To the shared warehouse push code git push..\ your-project.git\ master#3. Pull shares the version library code git pull..\ your-project.git\ master in another repository
Create a shared version library
Remote cooperative operation
Interact with the central warehouse
Check out the code from the remote end:
# format git clone path git clone git@github.com:liuyanqing1023/xcEduService.git
Submit the code to the central warehouse:
Git push # push code to the central warehouse
Get the code from the central warehouse:
Git pull
Summary
Workspace and version library: a workspace is a directory that contains A. git subdirectory (which contains the version library). We can use the init command to create a version library in the current directory.
Version submission: a version submission usually defines a version of all the files in the version library, detailing who created the version, when and where. Of course, we need to use the add command to determine which files will be included in the next submission, and then use the commit command to create a new version submission.
View information: through the status command, we can see which files have been modified locally and which changes will be included in the next submission. In addition, the log command can be used to display the submission history. The dirr command can be used to show the differences between the two versions of the file.
Cloning: for creating a copy of a version library with the clone command, we call it a clone of that version library. In general, each developer will have a complete clone of the entire project version library, and his or her workspace will contain the complete project history. This allows them to work independently without having to connect to the server.
Main send and pull: the push and pull commands can be used to share version submissions between local and remote version libraries
After reading the above, do you have any further understanding of the cooperative operation of Git? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.