Eclipse EGit, working with forked project. Getting updates from the original project - eclipse

Hello everybody I have this "big" and frustrating problem,
I have forked a project from git and as usual it is available in my account in GitHub. I then set up a project in eclipse selecting from an existing URI. All is ok, if I work with my own version of the project.
What I want to do is, because the project is changing and growing day by day, to have an updated copy from the original project and, every time I want to download any change I would like that the download is from the original project.
At the moment the only way (with EXTREMELY big problems) I found is using "Team > Fetch from Upstream" the changing the link to the repos using the "config" button. Obviously this lead to conflicts and annoying problems. I am sure that this is not the correct way to handle a forked repos and I need help.
I am using windows 7 and eclipse with egit, if I press Windows-R and then cmd it don't recognize the command "git" so I can't use console commands.
Any help?

With windows 7, you can install git to your machine and use console command as normal. (Link to download)
See this link to configure git to sync your fork with the original repo.
Hope this can help.

Related

Eclipse Team Synchronize shows Outgoing changes in 'Java Workspace' Model, where Git Model shows none

I've looked at the answers to similar questions here, and none fit the bill, or manage to solve the issue.
Using Eclipse Neon.3 (4.6.3) with EGit 4.7.0, and no other versioning system like SVN or CVS, calling Team > Synchronize on some of my Java projects, which have been synced with a Bitbucket repo many times over, and which show absolutely no changes whatsoever in the compare editor, including any whitespace differences, Eclipse still lists several .java source files as Outgoing changes under the "Java Workspace" model.
So for instance, calling Team > Synchronize on a project in my workspace, that is tracked in my local Git repo and remotely in a Cloud hosted Bitbucket, returns the following message:
There are no more Incoming/Outgoing changes for Git Commits. However Java Workspace has changes in Incoming/Outgoing mode.
Change to Java Workspace
Show All Models
A Google search for "However Java Workspace has changes" only yields a single result:
The sole hit is a reported bug in Subversive (one of the two main SVN integrations for Eclipse). However, while the described issue sounds like a rather accurate match of the issue I'm having, it claims that doing another Team > Synchronize, or restarting Eclipse would resolve the phantom Outgoing changes. Not so in my case, not with EGit.
Like I said, the remote and local files are exactly the same, incl. their whitespace/line endings.
Fetch/Pull from origin says there are no changes, everything is up to date.
Calling Replace With > HEAD Revision also doesn't help, Eclipse keeps insisting, that my workspace has Outgoing changes. Outgoing where?
This is obviously no big issue, merely an irritating nuissance. Still would be nice to get to the bottom of it.
...Did you try doing the Eclipse dance?
Edit: I find after some time Eclipse will behave strangely (example: dumping views I have enabled, losing track of files, or behaviour similar to what you are experiencing). When this happens I usually select and delete the project from my workspace, close Eclipse, reopen it and reopen the project.
I don't know why this happens or why this works as a fix.

Two versions of a same file - Git

My question may seem vague as I don't know much about git, but I'll try to be as clear as possible.
I have a repository on Github which I imported on Eclipse. As one could expect it, when I pulled on the command line the Eclipse project was refreshed (automatically, or manually, but it was clearly the same files) and when I modified the sources on Eclipse, it affected the git status.
I've had a huge build problem with Eclipse which led me to delete the project (not on the disk) and recreate it with Import existing projects into workspace. However, I noticed that the git status was unchanged when I edited the sources on Eclipse, so I pushed the changes on Eclipse, since it is imported as a git project. I thought it was ok, but I just discovered it was not the case. Here are two versions on the same file :
The version I want to priviledge :
https://github.com/jxw1102/Projet-merou/blob/ffe65c33c57b5d547fe7b79c7345d0788629e882/ModelChecker/src/cfg/Model.scala
The older version : https://github.com/jxw1102/Projet-merou/blob/master/ModelChecker/src/cfg/Model.scala
Also see their respective history : https://github.com/jxw1102/Projet-merou/commits/ffe65c33c57b5d547fe7b79c7345d0788629e882/ModelChecker/src/cfg/Model.scala
and https://github.com/jxw1102/Projet-merou/commits/master/ModelChecker/src/cfg/Model.scala
Now I can date the issue and fix it quite easily, but could someone explain me how it is possible (where exactly the code has been pushed, if not to master), and how to change the Eclipse project so that it pushes on master ?

Recover GIT delete Eclipse

I was trying to add bitbucket to my [existing] project on eclipse so I can commit it and have a GIT to work on, but I screwed up. In my GIT Repository Exploring there were 2 cloned project (the same) so I smartly deleted it to import again. The problem is, in my computer, the local folder with the project got deleted. I need to get my files back (as it was before trying to GIT it). Is there anyway I can do it? I'm desperate, since I've backed up 2 weeks ago and I have modified it a lot !
If Eclipse still has the project you can right click on the project and select Restore from Local History.... Eclipse will show you the files it has saved in its file history cache.

EGit greying out / not showing commit

I've been running into a wired problem (which has been described (but not solved) here as well:
I used to develop using PyDev and Egit (recent versions, EGit is 3.0.3) with just a local repository. Everything worked fine, I was able to commit, branch, reverse etc. just using the "Team" menue in my PyDev perspective.
Now I added a remote reposisory to host the project and since then, I can not commit to my local repository. File changes are not detected (even worse: I change file A and afterwards all folders are marked as "changed" (having the ">" icon) and no file is recognized as "needing synchronization". The only menu points which are available are "Add to index" (which has no effect) and "Pull" (which says "everything is up to date" - which is true since there is nothing new on the server to pull).
When I use git (either command line or git extensions), I see the changed file as changed and it's offered for staging. I can use plain git to commit, push, etc, everything works as expected and no error messages are shown. I'm just using one branch (master).
Even if I open the "Git Repository Exploring" perspective in Eclipse and got to the tab "Git Staging", the file is listed.
I jus started a new test project with just a local repository (residing in the same git-folder ~/git) and here I can commit as I'm used to... And I added the project to the same repository server - and still everthing works! I can commit, I can push, everything is fine there...
yes, I can work around hat by using git extensions, but I really liked the smooth integraion of git in eclipse. Therefore, all ideas, remarks etc. are very welcome! And yes, I tried restarting eclipse ;o).
Finally!!!
Since everything was working before I added the remote host, amd everything worked in my small toy project, I removed and re-added my remote host using gut bash:
git remote remove origin
git remote add origin git#my_servername:my_repository.git
I suppose some configuration files were corrupted in a very non-obvious way (I checked all config fiels and did not notice anything...)
Sounds like a bug, and you might be able to get it back to a good state by playing around with the plugin setting data.
Located here: ${workspace}/.metadata/.plugins
I highly recommend backing up that whole folder before you start playing around. I have had other eclipse issues that have been resolved by going in here and deleting things.

SVN: Problems with tag creation in Eclipse with Subversive

I'm trying to create to create a tag in svn repo for my project. I use Eclipse and Subversive plugin. Every time I try tagging, I get the following error:
Tag operation for some of selected resources failed.
svn: Commit failed (details follow):
svn: No write-lock in '/home/project/directory'
Where /home/directory is a directory in my project. I'm pretty sure that if I would delete the project and re-checkout it, then all will work.
Does anybody know what is the source of the problem and if there is a workaround to get it working without delete-checkout cycle?
Thanks for raising this issue! I just ran into this with Subversive 2.2.2 on Eclipse Indigo (3.7).
Cleaning up repository didn't work, but I noticed that the local copy has an old revision number (like 2, where the current is 37), although I am sure I committed before tagging.
So I ended up replacing the local code with the latest from repository, which updated the revision number. After that tagging worked like charm.
You find that error popping up from time (2008) (to time (2009)) to time (2010).
Since there isn't any answer, that usually means the problem got away (like relaunching Eclipse was enough to pass that ordeal).
It could be a permission issue, or a resource (like a file or directory) blocked by a process.
But if it is more complicated, you still have the command-line alternative (a svn copy)
VJ. reports in the comments:
I eventually tried svn update which explained me that the write lock is present in another path of SVN.
So I issued a svn clean for the from the root tree. Which cleared the issue.
Post that, svn update worked as well as svn switch.
You need to delete the File called 'lock' in the .svn Directory, then svn should work again.
regards.
You need to Clean up your project.
Right Click > Team > Cleanup
Then you can Switch to any branch you want
same issue here(just tried to create a branch instead of a tag in this case). check out the ultimate solution :
1) commit the code.
2) disconnect the project from SVN.
3) delete the project from the workspace.
4) check out the project.
5) try again.
voila!
its a bit overkill, but this works 100%
For me the solution was a simple "svn up" at the top of the project directory.