egit

使用Eclipse-Maven-git做Java开发(11)--egit环境准备

梦想与她 提交于 2019-11-28 18:33:24
前面的那么多篇博客都是在用eclipse和maven在进行项目,完全没有涉及git,接下来的博客就要涉及到git了,所以要把之前没有讲到的eclipse上的git支持组件egit的配置讲一下。 0、环境 本文说的“egit”指的是eclipse官方开发的eclipse上的git插件,无需额外安装任何的软件,只需要eclipse能够正常工作即可。 为了统一说明,我说一下我的eclipse版本吧,我是用的是STS-3.7.0,windows版本,相当于eclipse官方的4.5.0版本,其他的版本在界面上可能有一点小差异,但是都不影响正常使用,功能、流程什么的都是一样的。 最近一段时间都是在公司都是在linux(fedora)上使用eclipse,linux上用起来也是一样的,只是界面样式变了而已,就不单独说明了。 对于界面不一样的,大家对照着看哈,是在有需要的话,就下载相同的版本吧,地址是: http://spring.io/tools/sts/legacy 1、需要配置什么 如果说是全部的设置项的话,是有很多的,但是在这里我们没必要那么做,我们要设置的是本地保存位置、提交者的显示信息。 ps.关于git的介绍大家可以去网上找资料科普一下,顺便了解一下git怎样使用才是“最佳实践”,我不能说我的是最佳实践哈。 2、配置本地仓库保存的默认路径 相信大家也都了解了

使用Eclipse-Maven-git做Java开发(14)--开发中对git的使用

浪子不回头ぞ 提交于 2019-11-28 18:28:49
前面的文章说到了怎么讲本地的项目代码托管到git托管服务中,本文将来说一下日常的开发中对git的使用来进行开发。 (上次才说了要缩短更新时间,但是实在抱歉,中间出了一些事情,耽搁了一段时间)。 0、要求 要达到前一篇博客说明的条件,也就是代码已经托管到git中了,并且本地的环境那些也是对的。本次演示使用上一篇博客使用的那个工程。 1、远端代码到本地代码的同步 之前只说了本地代码提交推送到远端,有时候远端有更新的提交需要同步到本地来,接下来就演示一下怎么操作。 为了演示这种情况,我会在web上进行一次修改,模拟出有更新的提交,然后在本地的STS中进行查看与同步。 1.1 在web进行修改 点击“编辑”进行编辑,然后做出一些修改,提交。 修改过后的文件内容: 1.2 本地STS中查看修改 在同步之前,先在本地STS的仓库管理中对应的仓库上面查看历史,看看同步之前的样子,右键仓库记录->"show in"->"history": 从提交时间上可以看到,刚才的那次提交并不在列表中, 这也是符合git是分布式版本管理的设定的,接下来我们查看远端的代码仓库情况。右键仓库记录->"fetch from upstream",等到网络传输,然后会有提示说远端是否有改动。 但是这个时候在“history”视图是看不到的,因为还没有拉取下来,但是在仓库记录的条目上会有一个向下的箭头

EGit and Eclipse modifies .gitignore file but it should not

心已入冬 提交于 2019-11-28 18:26:35
问题 I'm using Eclipse and EGit, but Eclipse modifies my .gitignore file without me asking to do so. As soon as I open Eclipse the .gitignore file is modified. I've added some folders to .gitignore (through EGit) but removed them after, but Eclipse keeps adding removed lines to .gitignore . git checkout .gitignore , I get the good version of the file Then I go to Eclipse window Then I go back to terminal and issue: git status , I can see that .gitignore is now modified. How can it be? 回答1: By

git安装,简单配合eclipse使用

北城余情 提交于 2019-11-28 18:13:19
在 http://git.oschina.net 上注册一个项目; 在linux安装git(过程忽略); Git安装成功简单配置一下: git config --global user.name "XX" git config --global user.email xxxx@mail.com 生成密匙: ssh-keygen -t rsa -C "xxx@mail.com" # 密匙名如keyname,但不要有特殊字符,如,“.等等, 记住输入的密码(如果嫌麻烦,密码可以设置为空,这样提交的时候就不用输入密码了) 在 http://git.oschina.net/keys/new 保存密匙; 添加密匙: ssh-add keyname 可能步骤6会报错: ssh-add keyname Could not open a connection to your authentication agent. 解决方案:先执行命令 ssh-agent bash 然后重复步骤6; 测试连接是否成功: ssh -T git@git.oschina.net Welcome to Git@OSC, XX 表示成功; 创建本地仓库: mkdir ~/repository cd ~/repository git clone git@git.oschina.net:xxxx/test.git

Can't install Maven SCM Handler for EGit for Juno

安稳与你 提交于 2019-11-28 16:50:34
问题 I've updated my eclipse indigo to juno via the Help->Check for updates menu. I noticed I had updates for egit (2.x) and jgit (2.x) which clashed with my current installations (1.3.x) and so I removed all my egit plugins (eigt,jgit,egit-mylyn and Maven SCM Handler for EGit). I then tried to install the above egit plugins and was able to install egit and jgit but was unable to install Maven SCM Handler for EGit. I tried updating grvia the m2e marketplace and got the following error: Cannot

How do I change the default author and committer in the Eclipse Git plugin?

廉价感情. 提交于 2019-11-28 15:35:23
问题 I am using the Git plugin for Eclipse. I have several authors and committers which are displayed when I start typing in those fields. How can I provide changes to this list, or remove some author or committer? Also I want to set my default author and committer which will be displayed by default. 回答1: Click Window > Preferences > Team > Git > Configuration Click Add Entry and enter the key value pairs: Key: user.name Value: YourUsernameHere And Key: user.email Value: YourEmailHere 回答2: Each

Using native git not jgit in Eclipse git?

浪子不回头ぞ 提交于 2019-11-28 12:09:56
Is there any way to configure egit to use your native (OS) git and not the jgit implementation? If not, are there any alternative git Eclipse plugins? EDIT #1 - I should note, AWS CodeCommit uses a credential helper for auth, from .gitconfig: [credential] helper = !/usr/local/bin/aws --profile CodeCommitProfile codecommit credential-helper $@ UseHttpPath = true I'm guessing this is something specific to CodeCommit and is not in jgit. VonC EGit strictly uses JGit , the Java implementation of Git. The Git plugin in Aptana Sudio3 seems to be embedded in the product sources ( github.com/aptana

can't push upstream using EGit

感情迁移 提交于 2019-11-28 11:45:56
I use EGit in eclipse to pull and push. my config is: [remote "origin"] fetch = refs/heads/*:refs/remotes/origin/* push = refs/heads/*:refs/remotes/origin/* local branch is master Remote Tracking branch is origin/master when I do push, it comes out "origin/master:master[up to date]". Actually the remote branch is not up to date. I wander if I configure the wrong way. Sometimes I change different configure, I will get either "create a new branch"(which is wrong, as I just push some commits) or "reject-no fast forward"(which is strange, as I am the only user of the remote repository and I have

How to do an “ours” merge using the Eclipse git merge tool?

强颜欢笑 提交于 2019-11-28 10:11:45
I'm trying to do a merge where I have conflicts and one file has diverged massively. The eclipse git merge tool is great for small changes, but one of my files is large and has hundreds of explicitly marked conflicting sections. I can't for the life of me find an easy way to just do a merge using the "ours" strategy of just using my version and abandoning the remote version. On Linux or Mac it would be easy for me to just do it from the command line, but I'm on a corporate Windows computer and don't have command-line git. I even tried the workaround of doing "replace with" -> "Head revision"

EGit on Eclipse: How to git push --force?

北战南征 提交于 2019-11-28 09:10:28
I've run into a problem with my origin/branch being out of sync with my local branch, see below When I try to PUSH from my local "staging" branch to the origin/staging branch I get the "rejected - non-fast-forward" error. I use Eclipse with the EGit module on a windows PC. From another post here I see that I can resolve my issue with the "git push --force origin staging" to over-ride the origin/staging branch with my local branch. However, I don't see that option with EGit, and I don't see how to open a console in EGit to do this? Does anyone know if I can do this within EGit? OK - fixed my