search
HomeDevelopment ToolsgitGit&GitHub graphical interface operation, use of Git plug-in in Eclipse

Git&GitHub graphical interface operation, use of Git plug-in in Eclipse

Recommended (free): Git Tutorial

##Article Directory

    Eclipse plug-in settings
    • Eclipse initializes the local library
    • Set the local library signature range in Eclipse
    • Introduction to Git related icons in Eclipse
    • Ignore specific files in Eclipse
    • Basic operations of local libraries in Eclipse
    • Push the local warehouse to the remote library
    • Clone the project of the remote library to the local
    • Resolving conflicts in Eclipse

Git&GitHub graphical interface operation, use of Git plug-in in Eclipse

##Eclipse plug-in settings

Eclipse performs local library initialization

To perform local library initialization on the project, the corresponding command is

git init

    Project→right click→Team→Share Project→Git, enter the following interface:
  • Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
    Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
Set the local library signature range in Eclipse

Use the graphical interface directly, click Add Entry, and add the two configurations

user.name

and user.email.
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse

Git&GitHub graphical interface operation, use of Git plug-in in Eclipse

Introduction to Git related icons in Eclipse

Icon

Ignore specific files in Eclipse

Switch the directory to Navigator and you will find that there are some hidden files (Eclipse feature files):

  • .classpath file
  • .project file
  • All files in the .settings directory

These are files maintained by Eclipse to manage the projects we created, and have nothing to do with the developed code. Direct relationship. It's best not to track them in Git, i.e. just ignore them.

Why should Eclipse specific files be ignored?
It is difficult to ensure that everyone in the same team uses the same IDE tool. When the IDE tools are different, the relevant project-specific files may be different. If these files are added to version control, it is likely that conflicts will need to be resolved for these files during development.

Right-click on the project and select Team→Commit to enter the view interface:
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
Ignore the operation of Eclipse specific files:

Step one: Create a Java.gitignore file in the same directory as .gitconfig and write the following content.
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
This directory is usually 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.settings
target

Step 2: Modify the .gitconfig configuration file and add the following code to it

[core]
	excludesfile = C:/Users/Hudie/Java.gitignore[这里填的是自己创建的Java.gitignore文件的绝对路径]

Step 3: Restart Eclipse. At this point, Eclipse has completely ignored these feature files.

Basic operations of local libraries 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.)
    Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
    At this time, you can write comments in Commit Message After that, click the Commit button to submit to the local library:

Git&GitHub graphical interface operation, use of Git plug-in in Eclipse

##Push the local warehouse to the remote library

Create a remote library:


Git&GitHub graphical interface operation, use of Git plug-in in Eclipse Return to Eclipse, click Team→Remote→Push

Git&GitHub graphical interface operation, use of Git plug-in in Eclipse After pasting the Http address of the remote library into the URI, Click next:

Git&GitHub graphical interface operation, use of Git plug-in in Eclipse

After clicking

Add All Branches Spec, click next:
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse You can enter log information in the interface below.

Git&GitHub graphical interface operation, use of Git plug-in in Eclipse Successful push:

Git&GitHub graphical interface operation, use of Git plug-in in Eclipse

Clone the project of the remote library to the local

Oxygen Eclipse( The cloning project operations of Kepler Eclipse (with a higher version of Eclipse) and Kepler Eclipse (with a lower version of Eclipse) are different. The following demonstrates the operation of Oxygen Eclipse (the Eclipse version is higher) to clone the project from GitHub to the local Eclipse:

Step 1: Right-click on the eclipse project and select import to import the # in Git ##Projects form Git

Options:<p><img src="/static/imghwm/default1.png" data-src="https://img.php.cn/upload/article/000/000/052/08b28170d631626e56bcf263ffb08778-21.png?x-oss-process=image/resize,p_40" class="lazy" alt="Git&GitHub graphical interface operation, use of Git plug-in in Eclipse"><br> 然后选择<code>Clone URI
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
选择Eclipse的工作区目录:
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
选择作为一个普通的工程导入:
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
此时已经导入成功,但是并没有识别为Eclipse的项目,这样的目录是无法使用的。
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
将其转换为Maven工程:
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
此时,就已经符合Eclipse的开发了。
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse

注意:Kepler Eclipse(Eclipse版本较低)不能保存到当前Eclipse工作区目录。
解决方案是:不要放入工作区。
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse

在Eclipse中解决冲突

演示冲突的产生:
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
首先将一个项目push到远程库:Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
此时若push推送另一个项目,会出现拒绝push提示:
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse

正确的方式是先pull拉取下来,再进行操作:
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
此时可以看到冲突已经产生:
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
可以使用图形化界面的Merge Tool
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse
接下来就可以commit到本地库,进而push到远程库了。

如果在Eclipse中进行push时出现错误提示:The current branch is not configured for pull No value for key remote.origin,可以通过该项目.git目录下的config文件,添加下面两项内容:

[remote "origin"]
	url = https://github.com/FanChenALiang/TestGIt.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master

Description
Git&GitHub graphical interface operation, use of Git plug-in in Eclipse##Uncommitted changesGit&GitHub graphical interface operation, use of Git plug-in in Eclipse
The file is not tracked and is not within git version managementGit&GitHub graphical interface operation, use of Git plug-in in Eclipse
Added to the staging areaGit&GitHub graphical interface operation, use of Git plug-in in Eclipse
Just joined the staging areaGit&GitHub graphical interface operation, use of Git plug-in in Eclipse

The above is the detailed content of Git&GitHub graphical interface operation, use of Git plug-in in Eclipse. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:CSDN. If there is any infringement, please contact admin@php.cn delete
Git: The Core of Version Control, GitHub: Social CodingGit: The Core of Version Control, GitHub: Social CodingApr 23, 2025 am 12:04 AM

Git and GitHub are key tools for modern software development. Git provides version control capabilities to manage code through repositories, branches, commits and merges. GitHub provides code hosting and collaboration features such as Issues and PullRequests. Using Git and GitHub can significantly improve development efficiency and team collaboration capabilities.

Git: The Version Control System, GitHub: The Hosting PlatformGit: The Version Control System, GitHub: The Hosting PlatformApr 22, 2025 am 12:02 AM

Git is a distributed version control system developed by Linus Torvaz in 2005, and GitHub is a Git-based code hosting platform founded in 2008. Git supports branching and merges through snapshot management files, and GitHub provides pull requests, problem tracking and code review functions to facilitate team collaboration.

Git and GitHub: A Comparative AnalysisGit and GitHub: A Comparative AnalysisApr 21, 2025 am 12:10 AM

Git and GitHub are key tools in modern software development. Git is a distributed version control system, and GitHub is a Git-based code hosting platform. Git's core features include version control and branch management, while GitHub provides collaboration and project management tools. When using Git, developers can track file changes and work together; when using GitHub, teams can collaborate through PullRequests and Issues.

GitHub: An Introduction to the Code Hosting PlatformGitHub: An Introduction to the Code Hosting PlatformApr 20, 2025 am 12:10 AM

GitHubiscrucialforsoftwaredevelopmentduetoitscomprehensiveecosystemforcodemanagementandcollaboration.Itoffersversioncontrol,communitysupport,andtoolslikeGitHubActionsandPages.Startbymasteringbasicslikecreatingarepository,usingbranches,andautomatingwo

Git and GitHub: Essential Tools for DevelopersGit and GitHub: Essential Tools for DevelopersApr 19, 2025 am 12:17 AM

Git and GitHub are essential tools for modern developers. 1. Use Git for version control: create branches for parallel development, merge branches, and roll back errors. 2. Use GitHub for team collaboration: code review through PullRequest to resolve merge conflicts. 3. Practical tips and best practices: submit regularly, submit messages clearly, use .gitignore, and back up the code base regularly.

Git and GitHub: Their Relationship ExplainedGit and GitHub: Their Relationship ExplainedApr 18, 2025 am 12:03 AM

Git and GitHub are not the same thing: Git is a distributed version control system, and GitHub is an online platform based on Git. Git helps developers manage code versions and achieve collaboration through branching, merge and other functions; GitHub provides code hosting, review, problem management and social interaction functions, enhancing Git's collaboration capabilities.

What do you need to set after downloading GitWhat do you need to set after downloading GitApr 17, 2025 pm 04:57 PM

After installing Git, in order to use more efficiently, the following settings are required: Set user information (name and mailbox) Select text editor Set external merge tool Generate SSH key settings Ignore file mode

What to do if the git download is not activeWhat to do if the git download is not activeApr 17, 2025 pm 04:54 PM

Resolve: When Git download speed is slow, you can take the following steps: Check the network connection and try to switch the connection method. Optimize Git configuration: Increase the POST buffer size (git config --global http.postBuffer 524288000), and reduce the low-speed limit (git config --global http.lowSpeedLimit 1000). Use a Git proxy (such as git-proxy or git-lfs-proxy). Try using a different Git client (such as Sourcetree or Github Desktop). Check for fire protection

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.