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
1) Create a maven project
a new file in the following several maven project
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
create warehouse
Click Finish
Effects
1) generate a file .git
2) maven project also changed
at this time can be added through the Add Entry warehouse signature
different tag file
project submitted by the new
right-engineering ---- team ---- commit
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特定文件可能不同),相关工
程特定文件就有可能不同。如果这些文件加入版本控制,那么开发时很可能需要为
了这些文件解决冲突。
GitHub 官网样例文件(忽略文件样例)
https://github.com/github/gitignore
https://github.com/github/gitignore/blob/master/Java.gitignore
编辑本地忽略配置文件,文件名任意
下载java.ignore文件,并在文件添加如下内容(提交过程中忽略的文件)
.classpath
.project
.settings
target
将编辑完成的忽略文件放到.gitconfig同一路径下
在~/.gitconfig(用户家目录下的git系统配置文件) 文件中引入上述忽略文件
添加如下引用
[core]
excludesfile = C:/Users/MAC/Java.gitignore (忽略文件的所在路径)
[ 注意:这里路径中一定要使用“ “/” ” ,不能使用“ “\ ”]
配置好以后打开eclipse–team-git 可以看到配置的core 忽略文件已经引用成功了
eclipse 工作区文件添加到暂存区
工程右键—team—Add to index(相当于鼠标拖拽)
Effect
at this time works right -team-commit view file submission
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
to submit completed 3 area are blank, the project status as follows
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
Input copy remote repository http address, account password input github
click the middle button Add All Branches Spec (add all the branches detected)
Click the next (log information may be added) or Finish
. 3 Oxygen cloning the Eclipse operating path
right import-git- git from URI-next remote-next --clone
to the remote database replication project addresses
specify where the project
Designated project into the way,Here can only be used: Import as general project
Right-Configure-Convert to Maven Project (adjust the directory structure)
** 4 Kepler Eclipse cloning project operations **
Problem: You can not save the current Eclipse workspace directory put under a different path
5 eclipse resolve conflicts
conflict to pull into a local
conflict File → Right → Team → Merge Tool
After editing performed normally add / commit operation can