Eight, Git - Eclipse operation

A, Git - Eclipse operating

1 project initialization and submitted to the local library

Eclipse has integrated default git plugin, no manual installation, configuration view signature information
Here Insert Picture Description

1) Create a maven project
Here Insert Picture Description
Here Insert Picture Description
a new file in the following several maven project
Here Insert Picture Description
execution initialization init (initialize the git project, you can see works created under the .git files)
implementation of the road
project → Right → Team → Share Project → Git
Here Insert Picture Description
create warehouse
Here Insert Picture Description
Click Finish

Effects
1) generate a file .git
Here Insert Picture Description
2) maven project also changed
Here Insert Picture Description
at this time can be added through the Add Entry warehouse signature
Here Insert Picture Description
different tag file
Here Insert Picture Description
project submitted by the new
right-engineering ---- team ---- commit

Here Insert Picture Description
git submission window is divided into three regions
modify Unstaged Changes are not buffered (changes in the work area)
if submitted directly to the file, then drag the mouse to Staged Changes in filtered ignore files

Staged Changes staging changes (changes in the temporary area)
information submitted Commit Message (submissions local library)

Eclipse ignores file .classpath file .project file .settings directory of all files
concept: Eclipse specific files
which are Eclipse project we created in order to manage and maintain files, and code development are not directly related. Best not to be tracked in Git, which is to ignore them.

为什么要忽略 Eclipse 特定文件呢?
同一个团队中很难保证大家使用相同的 IDE 工具,而 IDE 工具不同时(每个版本的eclipse特定文件可能不同),相关工
程特定文件就有可能不同。如果这些文件加入版本控制,那么开发时很可能需要为
了这些文件解决冲突。

Here Insert Picture Description

GitHub 官网样例文件(忽略文件样例)
https://github.com/github/gitignore
https://github.com/github/gitignore/blob/master/Java.gitignore
编辑本地忽略配置文件,文件名任意

Here Insert Picture Description
Here Insert Picture Description
下载java.ignore文件,并在文件添加如下内容(提交过程中忽略的文件)
.classpath
.project
.settings
target

将编辑完成的忽略文件放到.gitconfig同一路径下

在~/.gitconfig(用户家目录下的git系统配置文件) 文件中引入上述忽略文件
添加如下引用
[core]
excludesfile = C:/Users/MAC/Java.gitignore (忽略文件的所在路径)
[ 注意:这里路径中一定要使用“ “/” ” ,不能使用“ “\ ”]
Here Insert Picture Description
配置好以后打开eclipse–team-git 可以看到配置的core 忽略文件已经引用成功了
Here Insert Picture Description

eclipse 工作区文件添加到暂存区
工程右键—team—Add to index(相当于鼠标拖拽)

Effect
Here Insert Picture Description
at this time works right -team-commit view file submission
Here Insert Picture Description
file workspace have all submitted to the staging area, submit comments in writing commit massage, click submit, submit the code to the staging area of the local library
Here Insert Picture Description
to submit completed 3 area are blank, the project status as follows
Here Insert Picture Description

2 eclipse local library is pushed to the remote repository
github create a new remote database (preferably with a local library with the same name gitTest), copy the http address of the remote library
project Right -team-Remote-Push

Here Insert Picture Description
Input copy remote repository http address, account password input github
Here Insert Picture Description
click the middle button Add All Branches Spec (add all the branches detected)
Here Insert Picture Description
Here Insert Picture Description
Click the next (log information may be added) or Finish
Here Insert Picture Description
. 3 Oxygen cloning the Eclipse operating path
right import-git- git from URI-next remote-next --clone
Here Insert Picture Description
Here Insert Picture Description
to the remote database replication project addresses
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
specify where the project

Here Insert Picture Description
Designated project into the way,Here can only be used: Import as general project

Here Insert Picture Description
Right-Configure-Convert to Maven Project (adjust the directory structure)
Here Insert Picture Description
** 4 Kepler Eclipse cloning project operations **

Problem: You can not save the current Eclipse workspace directory put under a different path
Here Insert Picture Description
5 eclipse resolve conflicts
conflict to pull into a local
conflict File → Right → Team → Merge Tool
After editing performed normally add / commit operation can

Guess you like

Origin blog.csdn.net/m0_38143867/article/details/92798794