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

How git push local projects are pushed to remote branches

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article focuses on "how to push git push local projects to remote branches". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to push git push local projects to remote branches.

1. Under the folder of the local project, the git repository initializes git init

Initialize the local git repository

two。

Git add *

Add a local file index to the git library

3.

The log is submitted after git commit-m "first" #-m

4.

Git branch

You can check the local warehouse branch and find that a branch of master appears.

5. Configure remote warehouse

Git remote add test http://xxxx@git.XXXX.com/scm/wbqa/xxxx.git# test is the remote warehouse alias followed by http for the remote warehouse address

6. After the configuration is completed, you can use the git remote-v command to check whether it is in effect.

7. Use the push command to submit the code to the remote corresponding branch

$git push: git push test master:jenkinsapi#test is the set remote warehouse alias, master is the local branch name, and jenkinsapi is the remote branch name

If the remote warehouse user name and password are not configured, the push code will allow the user name and password to be entered. After success, the following information will appear, which can be configured using the git config command.

Counting objects: 20, done.Delta compression using up to 8 threads.Compressing objects: 100% (16 MiB), done.Writing objects: 100% (20 MiB), 2.63 MiB | 6.97 MiB/s, done.Total 20 (delta 0) Reused 0 (delta 0) remote: remote: Create pull request for jenkinsapi:remote: http://git.xxxxxxx.com/projects/WBQA/repos/xxxxxxx_api_xxxx_api_case/compare/commits?sourceBranch=refs/heads/jenkinsapiremote: To http://git.xxxxxxx.com/scm/wbqa/xxxxxxx_api_xxxxx_api_case.git * [new branch] master-> jenkinsapi

8. If you look at the remote warehouse at this point, you will find that there is an extra branch named after jenkinsapi.

At this point, I believe you have a deeper understanding of "how git push local projects are pushed to remote branches". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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