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 commands that I often use in my work

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article records the Git commands commonly used by bloggers in their real work.

Note: for more comprehensive Git commands, please consult du Niang or official documentation.

Clone project

Git clone-b Branch name to update (for example: master) http:// username: password @ 192.168.66.66/root/xxx.git

Description: 1. Create a directory to store the project before cloning, and try not to have Chinese in the path.

two。 Http protocol + specified branch name + specified user name and password are used here.

two。 Update Project + submit Project

Bloggers strongly recommend using tools such as SourceTree to update and submit operations.

Because if there is a code conflict, it will be very painful, mainly for fear of overwriting other people's code.

-if you are good enough, please ignore it. Ha ha

3. View the branches that have been checked out locally (the current branch will be marked)

Git branch

Git status / / View information about the current branch

4. View all branches of the remote warehouse (including Tag)

Command: git ls-remote

5. Check out branch

Git checkout master / / switch to the master branch

6. Create another branch based on the current branch

Git branch master_bak / / created a master_bak branch locally

Git push origin master_bak / / push local branches to remote repositories

7. Create a Tag based on the current branch

Git tag-a tag name-m 'tag description text'

Git push origin tag name / / push the locally created tag to the remote repository

8. Delete tag (local + remote)

Git tag-d tag name / / Delete local tag

Git push orgin: refs/tag/tag name / / delete the tag on the remote warehouse

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

Servers

Wechat

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

12
Report