In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the graphical interface operation of Git&GitHub, the use case of Git plug-in in Eclipse, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.
Eclipse plug-in Settings
Eclipse initializes the local library
Initialize the project to the local library, and the corresponding command is git init
Project → right-click → Team → Share Project → Git to enter the following interface:
Set the signature scope of the local library in Eclipse
Directly use the graphical interface, Add Entry in, add user.name and user.email two configuration.
Introduction of Git related icons in Eclipse
The icon indicates that the uncommitted changes are not tracked and are not added to the git version management. The temporary storage area has just been added.
Ignore specific files in Eclipse
Change the directory to Navigator and you can find some hidden files (Eclipse characteristic files):
.classpath file
.project file
All files in the .settings directory
These are the files maintained by Eclipse to manage the project we created, and are not directly related to the developed code. It's best not to track them in Git, that is, to ignore them.
Why ignore Eclipse specific files?
It is difficult to ensure that everyone in the same team uses the same IDE tool, but if the IDE tool is different, the relevant project-specific files may be different. If these files are versioned, you will most likely need to resolve conflicts for these files during development.
Right-click Team → Commit on the project to enter the view interface:
Ignore actions for Eclipse-specific files:
Step 1: create a Java.gitignore file in the directory at the same level as .gitconfig and write the following.
The directory is generally under the user folder.
# Compiled class file*.class# Log file*.log# BlueJ files*.ctxt# Mobile Tools for Java (J2ME). Mtj.tmp/# Package Files # * .jar * .war * .nar * .ear * .zip * .tar.gz * .rar # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xmlhs_err_pid*.classpath.project.settingstarget
Step 2: modify the .gitconfig configuration file by adding the following code
[core] excludesfile = C:/Users/Hudie/Java.gitignore [fill in the absolute path of the Java.gitignore file created by yourself]
Step 3: Restart the Eclipse once. At this point, Eclipse has completely ignored these feature files.
Basic operation of local library in Eclipse
Add to staging area: equivalent to git add [file name] command
(in addition to clicking the Add to Index button below, you can also drag and drop.)
After you can write comments in Commit Message, click the Commit button to submit to the local library:
Push the local warehouse to the remote repository
Create a remote library:
Go back to Eclipse and click Team → Remote → Push
After pasting the Http address of the remote library into URI, click next:
After clicking Add All Branches Spec, click next:
You can enter log information in the interface below.
The push succeeded:
Clone the project of the remote library locally
The clone engineering operations of Oxygen Eclipse (higher version of Eclipse) and Kepler Eclipse (lower version of Eclipse) are different. The following demonstrates the operation of Oxygen Eclipse (a later version of Eclipse) to clone a project from GitHub to a local Eclipse:
Step 1: right-click import in the eclipse project and import the Projects form Git option in Git:
Then select Clone URI:
Select the workspace directory for Eclipse:
Choose to import as a normal project:
At this point, the import is successful, but the project is not recognized as Eclipse, and such a directory is not available.
Convert it to a Maven project:
At this point, it is already in line with the development of Eclipse.
Note: Kepler Eclipse (lower version of Eclipse) cannot be saved to the current Eclipse workspace directory.
The solution is: don't put it in the workspace.
Resolve conflicts in Eclipse
Demonstrate the generation of conflicts:
First push a project to the remote library:
At this point, if push pushes another project, you will be prompted to reject push:
The correct way is to pull it down by pull before performing the operation:
At this point, you can see that the conflict has occurred:
You can use Merge Tool with a graphical interface
Then you can commit to the local library, and then push to the remote library.
If you get an error message when doing push in Eclipse: The current branch is not configured for pull No value for key remote.origin, you can add the following two items through the config file in the .git directory of the project:
[remote "origin"] url = https://github.com/FanChenALiang/TestGIt.git fetch = + refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master Thank you for reading this article carefully. I hope the article "graphical interface operation of Git&GitHub and use cases of Git plug-ins in Eclipse" shared by the editor will be helpful to you. At the same time, I also hope that you will support and pay attention to the industry information channel, and more related knowledge is waiting for you 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.
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.