Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Git submit code and update code command

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Official Wechat account: a non-academic class.

Follow for more java tutorials and other resource videos. For questions or suggestions, please leave a message on the official account.

1.Git submission Code

To submit code using a command:

1.1. Pull the server code to avoid overwriting other people's code

Git pull

1.2. See which files have been modified in the current project

Git status

The specific status is as follows:

Untracked: for tracking, it is usually a new file, which is in the folder, but not added to the git library, does not participate in version control, through git add

The status changes to StagedModified: the file has been modified, only modified, and no other operations have been done deleted: file deletion, local deletion, no deletion on the server

1.3. Submit the code that changes the state to the cache

Git add + file git add-u + path: submit the modified tracked code to the cache git add-A + path: submit the modified untracked code to the cache (untracked is usually a new file) for example: git add-u vpaas-frontend/src/components submits the tracked modified code in the vpaas-frontend/src/components directory to the cache git add-A vpaas-frontend/src/components The modified code that is not tracked in the vpaas-frontend/src/components directory is submitted to the cache git add. Use the above command to submit all modified files to the cache

1.4. Submit the code to the local warehouse

Git commit-m "[modify project code]"

1.5. Push the code of the cache to the Git server

Git push2.Git updates the code locally

2.1 look at your branch before submitting the code

Git branch-View the branch git checkout + Branch name-switch the branch

2.2 but before switching branches, make sure that the workspace is clean, that is, there is no modification, if there is a modified test execution.

Git stash-put the modified code into the staging area git checkout + branch name-switch branch

2.3 when you want to switch back to the branch one day

Git stash pop-retrieve the modified code stored in the staging area back to the workspace

2.4 after viewing the branch, follow the code of the new remote library to the local

Git pull-pull the code of the remote library locally

Finally, share a wave of java resources, including a full set of videos from entry to development of java, as well as 26 projects of java. The resources are relatively large, the size is about 290g, and the link is easy to fail. The way to get it is to follow the official account: non-subject class, and then reply: java project can be obtained, I wish you all a happy study.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report