Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
W
wiki-java
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • 老徐
  • wiki-java
  • Wiki
  • git configuration and simple use

Last edited by 梅俊辉 Jun 16, 2016
Page history

git configuration and simple use

Eclipise中,import〉Project from Git ,单击Next
选中Clone URI, Next
1

输入uri,user,password,选择HTTP协议

2

Next,
选择要检出的分支

3

Next
4

Next

5
Next
6

单击finish,项目会自动导入

配置git参数:
Window > Preferences > Team >Git >Configuration
UserSettings > AddEntry
添加user.name和user.email

7
Next

8
单击Apply保存

Window > Preferences > Team >Git >Configuration
Repository Settings

9
或者直接单击location右边的 open,出现一个config文件
复制以下内容进去即可
[core]
symlinks = false
repositoryformatversion = 0
filemode = false
logallrefupdates = true
[remote "origin"]
url = http://tech.pingansec.com/ulindows/project_ucs.git
fetch = +refs/heads/:refs/remotes/origin/
[branch "test"]
remote = origin
merge = refs/heads/test
'注意':如果checkout出来的是master分支,则
[branch "master"]
remote = origin
merge = refs/heads/master
高版本的Eclipse默认会配置好 Repository Settings部分


Eclipse Git操作

提交代码到本地服务器:
选中项目 ,Team> commit

10

提交代码到远程仓库:
Team > remote > push

11

12

13

单击 AddSpec后,Specifications for push下面会出现 一条记录,
记住不要勾选 Force update
后面就直接 next, 再 finish就行了

git 切换分支:
Team > Switch to > 分支名称

从远程获仓库获取最新的代码到本地:
Team > pull

git解决冲突:
代码在提交到远程仓库之前,先Team> pull 获取最新代码,

14

此处Test.java提示冲突, 右击Test.java ,单击merge tool

15
合并、处理代码后,
右击 Test.java, 单击 Add to Git Index
再Commit And Push

16

Clone repository
  • git configuration and simple use
  • Home
  • java code specification
  • maven environment configuration
  • shuidi js develope
  • ucs_project environment configuration