search
HomeDevelopment ToolsgitTake a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse

Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse

Article directory

  • Eclipse plug-in settings
    • Eclipse performs local library initialization
    • 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
    • Resolve conflicts in Eclipse

Recommended (free): Git tutorial


Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse

##Eclipse plug-in settings

Eclipse initializes the local library

To initialize the local library of the project, the corresponding command is

git init

  • Project→right click→Team→Share Project→Git, enter the following interface: Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse
    Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse

Settings in Eclipse The local library signature range

directly uses the graphical interface, Add Entry, and adds the two configurations

user.name and user.email.
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse

Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse

Introduction to Git related icons in Eclipse

IconDescription

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:
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse
Take a look at the Git&GitHub graphical interface operation and the 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.
Take a look at the Git&GitHub graphical interface operation and the 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.)
    Take a look at the Git&GitHub graphical interface operation and the 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:

Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse

##Push the local warehouse to the remote library

Create a remote library:


Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse Return to Eclipse, click Team→Remote→Push

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

Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse

After clicking

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

Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse Successful push:

Take a look at the Git&GitHub graphical interface operation and the 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/c6a6d7f698878501d7fdc16c9c6aa759-21.png?x-oss-process=image/resize,p_40" class="lazy" alt="Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse"><br> 然后选择<code>Clone URI
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse
选择Eclipse的工作区目录:
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse
选择作为一个普通的工程导入:
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse
此时已经导入成功,但是并没有识别为Eclipse的项目,这样的目录是无法使用的。
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse
将其转换为Maven工程:
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse
此时,就已经符合Eclipse的开发了。
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse

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

在Eclipse中解决冲突

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

正确的方式是先pull拉取下来,再进行操作:
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse
此时可以看到冲突已经产生:
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse
可以使用图形化界面的Merge Tool
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse
Take a look at the Git&GitHub graphical interface operation and the 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

    

Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in EclipseTake a look at the Git&GitHub graphical interface operation and the use of Git plug-in in Eclipse##Uncommitted changes
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in EclipseThe file is not tracked and is not within git version management
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in EclipseAdded to the staging area
Take a look at the Git&GitHub graphical interface operation and the use of Git plug-in in EclipseJust joined the staging area

The above is the detailed content of Take a look at the Git&GitHub graphical interface operation and the 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
GitHub: The Platform for Developers and ProjectsGitHub: The Platform for Developers and ProjectsApr 13, 2025 am 12:01 AM

The core features of GitHub include version control, branch management, code review, issue tracking and project management. 1. Version control and branch management are based on Git, allowing tracking of code changes and experimental development. 2. Code review is implemented through PullRequest to improve code quality and team collaboration. 3. Issues tracking and project management are carried out through Issues and the project management board to improve project transparency and traceability.

GitHub in Action: Examples and Use CasesGitHub in Action: Examples and Use CasesApr 12, 2025 am 12:16 AM

GitHub is a powerful tool to improve the efficiency and quality of software development. 1) Version control: manage code changes through Git. 2) PullRequests: Conduct code review and improve code quality. 3) Issues: Track bugs and project progress. 4) GitHubActions: Automate the construction, testing and deployment process.

Git vs. GitHub: Version Control and Code HostingGit vs. GitHub: Version Control and Code HostingApr 11, 2025 am 11:33 AM

Git is a version control system, and GitHub is a Git-based code hosting platform. Git is used to manage code versions and supports local operations; GitHub provides online collaboration tools such as Issue tracking and PullRequest.

What is Git in simple words?What is Git in simple words?Apr 09, 2025 am 12:12 AM

Git is an open source distributed version control system that helps developers track file changes, work together and manage code versions. Its core functions include: 1) record code modifications, 2) fallback to previous versions, 3) collaborative development, and 4) create and manage branches for parallel development.

Is Git the same as GitHub?Is Git the same as GitHub?Apr 08, 2025 am 12:13 AM

Git and GitHub are not the same thing. Git is a version control system, and GitHub is a Git-based code hosting platform. Git is used to manage code versions, and GitHub provides an online collaboration environment.

How to use GitHub for HTML?How to use GitHub for HTML?Apr 07, 2025 am 12:13 AM

The reason for using GitHub to manage HTML projects is that it provides a platform for version control, collaborative development and presentation of works. The specific steps include: 1. Create and initialize the Git repository, 2. Add and submit HTML files, 3. Push to GitHub, 4. Use GitHubPages to deploy web pages, 5. Use GitHubActions to automate building and deployment. In addition, GitHub also supports code review, Issue and PullRequest features to help optimize and collaborate on HTML projects.

Should I start with Git or GitHub?Should I start with Git or GitHub?Apr 06, 2025 am 12:09 AM

Starting from Git is more suitable for a deep understanding of version control principles, and starting from GitHub is more suitable for focusing on collaboration and code hosting. 1.Git is a distributed version control system that helps manage code version history. 2. GitHub is an online platform based on Git, providing code hosting and collaboration capabilities.

Does Microsoft own Git or GitHub?Does Microsoft own Git or GitHub?Apr 05, 2025 am 12:20 AM

Microsoft does not own Git, but owns GitHub. 1.Git is a distributed version control system created by Linus Torvaz in 2005. 2. GitHub is an online code hosting platform based on Git. It was founded in 2008 and acquired by Microsoft in 2018.

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

EditPlus Chinese cracked version

EditPlus Chinese cracked version

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

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use