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 to apply GIT in practice and solve the conflict problem

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article introduces you how to carry out GIT actual combat application and conflict resolution, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Command flow chart

Second, install Git

Eclipse has integrated Git

Configure SSH key

Install GIT Bash first

E:\ software\ work\ git\ Git-2.7.2-32-bit_setup.1457942412

Open the D:\ Program Files (x86)\ Git\ git-bash.exe command window

Refer to point 5 of the GIT usage Guide to configure the SSH key

E:\ software\ work\ git\ GTI user Guide-Integration _ full version _ _ V0.5

The first step is to set the user name and email of Git: (if this is the first time)

Git config-global user.name "userId"

Git config-global user.email "userId@cns.com"

Step 2: create a SSH Key

Ssh-keygen-t rsa-C "userId@cnsuning.com"

Note: there are no spaces in the ssh-keygen

Enter three times in a row.

You end up with two files in the C:\ Users\ userId\ .ssh directory: id_rsa and id_rsa.pub.

Configure the generated SSH key to the remote warehouse Gitlab platform

Set-SSH key-paste key-add key

Restart Eclipse,SSH mode to clone code

Clone code

Note: master branches should also be checked when cloning branches.

1 、

2 、

Code submission order:

Commit-- > pull-- > push

2. Git conflict (Eclipse test)

S1: right-click the package of the file and select Synchronize Workspace

S2:Merge Tool will show a comparison between local and up-to-date code

S3: save the new / modified code in this file and overwrite the latest code of the remote branch locally

S4:Marked as Merge

S5:Add to Git Index

S6GradeCommit-> Push to Upstream

S7: copy the previously added / modified code and resubmit the file

Third, switch branches

Method 1:

Team-- > Switch To-- > Other-- > Remote Tracking-- > find the latest branch-- > check out

Method 2:

Team-- > Switch To-- > New Branch-- > enter the latest branch name manually

About how to carry on the GIT actual combat application and the conflict resolution question to share here, hoped that the above content can have the certain help to everybody, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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