In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use the git command to upload code related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will have something to gain after reading this article on how to use the git command to upload code, let's take a look.
First, check the status of the current file
Use the git status command to see which files have been modified, generally in the following states:
1. Untracked: not tracked, this file is in the folder, but not added to the git library, does not participate in version control. Change to Staged through the git add state.
2. Modified: the file has been modified, only modified, and no other operations have been done.
3. Deleted: the file has been deleted, deleted locally, and not deleted on the server.
Examples are as follows:
Open the git bash client and enter the git status command:
Then enter, you can see the changes to the current workspace, where the red font indicates the modified file:
Add the modified files to the local git cache
Use git add. Or the git add xxx command can add the modified file to the local git cache.
1. If you git status check the current status and find that all the files you have modified have to be submitted, then you can use git add directly. You can add all your content to the local git cache.
Note: git add. (followed by a dot) means to add all files in the directory to the local git cache. As shown in the following figure:
2. If you git status checked the current status and found that there are some files you do not want to submit, then use the git add xxx (xxx represents the file name you want to add) command to submit some files to the local git cache. As shown in the following figure:
Submit the code to the local warehouse
Use the command: git commit-m "add your comments, usually some change information" to push and modify the files in the local git cache to the local git library. As shown in the following figure:
Fourth, get the update of a branch of the remote host and merge with the specified branch of the local computer.
You can use the git pull command to get updates for a branch of a remote host. For example, if the remote host is the origin remote main branch named master, we can write it as git pull origin master. As shown in the following figure:
Fifth, push the local git library code to a branch of the remote host.
Using the git push command, you can push the code currently submitted to the local git repository to a remote branch on the remote host. As shown in the following figure:
Note:
1. When part IV gets updates from the remote branch and merges with the local git library code, there may be a conflict, which needs to be resolved before push to the remote branch.
2. When you push to the remote branch in step 5, you may have to enter the user name and password of the git. Just follow the prompts to enter the user name and password.
This is the end of the article on "how to upload code using git commands". Thank you for reading! I believe you all have a certain understanding of "how to use git commands to upload code". If you want to learn more, you are welcome to follow the industry information channel.
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.