Dissapearing Git Repository in eGit - eclipse

This is the second time this has happened to me, and I don't know what's happening. I have a Git repository that I manage within Eclipse using eGit. I've been working with this repository steadily for months. Suddenly the repository is no longer available in the "Git Repositories" view. I try to add it back using the "add" utility. The dialog sees the repository, and allows me to select it, but it never adds it back to the view.
The last time this happened I had to complete remove my project, the folder, and add it from remote from scratch. I really don't want to have to do that again. Any suggestions?

That view should be reading the contents from a file.
workspace/.metadata/.plugins/.org.eclipse.core.runtime/.settings/org.eclipse.egit.core.prefs
Perhaps check its content to see what's in there, perhaps the path that's being stored has been corrupted or something.

Related

How to save multiple versions of a file on GitHub

I'm fairly new to programming and thought I'd try out version control. I created a GitHub account to help me track my journey of creating my first webpage.
I want to upload updated versions of my code as I go along (e.g. Stage1, then perhaps when I progress a little further Stage2, then Stage 3 etc). This would essentially be the same file of code but each time it will be added to/ edited slightly.
Could someone advise me as to how to do this?
Thank you! :)
Every commit you push to your repository is stored and then you can access every version that you have committed afterward.
Just go into your repo, click at your commits tab:
Commits Tab
Then you can access the version by clicking the commit hash you desire to browse:
Commit hash abbreviated
After this, you just click in browse files.
If you want to use in your computer another version, you just have to git checkout 'commit hash' inside your folder at sync with your git repo.

Eclipse Git Repository Branch Hash not updating

I been trying to follow this tutorial on using Eclipse and GITHUB when multiple people are writing within the same project using branches. I believe I understand everything and how its working.. HOWEVER.. my hash isn't updating like the video is showing on local branches.
https://www.youtube.com/watch?v=KfeqnernMmE
If you look at minute 3:50 - 3:60 you will see him do a COMMIT and it will then update on the local branch and generates a new HASH etc...(text in grey next to ChangeDefaults in the video) My Eclipse won't freaking do this. I make a change exactly like he does, I do a commit, but my Hash's and comment text (all the text in GREY) don't update or change at all. They same the exact same as it was before and I'm not seeing any onscreen errors or anything.
What am I missing?
Apparently there were 2 things I was doing wrong.
1) I wasn't using the correct Repository when I was modifying things. I had the wrong "Project" open.
2) I was missing an update and had to update my GIT inside my eclipse.

Egit at Eclipse: can I see changes in files on commit screen?

I need preview like in IntelliJ IDEA. Strange that this is not the default behaviour.
Yes very strange. I solved that using the Git Staging view.
Go to Window -> Show view -> Other, and select Git Staging.
There you can see all you need in order to do a proper commit, unstaged changes, changes, even conflicts. And of course you can do a commit or commit and push directly.
I think the idea in Eclipse is to do commits from synchronization view and to be consistent between different team providers. The former comes from old times when CVS and SVN ruled. Nowadays it seems to be a cumbersome way to do it.
Heck, even SVN team providers allow you to revert changes from the Java view while from EGit you can either reset the whole working copy or you need to go to Synchronization view and use cryptic Overwrite option for a single element. Of course changes in files that you're asking about are there.

Undo mark as merged

I am using Eclipse Indigo and subeclipse as the svn plugin for eclipse. Now here is the situation. I was synchronizing my project with the remote repository. There were conflicts present and I mistakenly clicked on "mark as merged" for one of the files without merging it. I tried restarting eclipse and some other stupid hacks. But nothing works out. So is there a way to undo "mark as merged" action?
Mark as Merged means that the local version of the file contains the content you want, after having compared the files and manually resolving issues. Subclipse still has to update the local file so that SVN's metadata is happy, so it saves the current content of the file, runs svn update, and then replaces the file.
So you can now run Team > Revert if you want the file to match what was in the repository, or Compare with > Base Revision if you just want to examine the differences again and possibly make more changes.
Neither of Marks suggestions worked for me. The class did revert back to the original (pre-merged) state, but trying to Merge again just gave me a 'no differences detected' message.
What did end up working for me was to Compare With > Local History. I was able to pick a version that was right before I hit Mark As Merged, and that got me back to the Compare Editor view that I had during the original Merge (which showed all the conflicts). I was then able to change the code correctly, and Mark As Merged again.
Delete the local project and re-import it, and this has the effect of undoing an accidental 'Mark as Merged' action. Just make sure that the deletion won't result in loss of uncommitted work.

Subclipse conflict resolution

Me and my friend using flex builder (eclipse based) with subclipse for a project.
Before committing I always update but sometimes I could not commit because of conflicts. Then I use Team->Synchronize with Repository and it shows at the right side latest from repository and at the left side the my current working copy. It has a button to copy from all non-conflicts from right to left (from latest repository to my working copy). But there are still conflicting lines.
Sometimes I just want to copy from left to right but there is no button for that (I mean overwriting repository file lines with my lines). After copying non-conflicting parts from right to left I just want to commit left side (I want to overwrite and commit my final file to repository). I cannot commit because of these conflict issues. Then my friend can use Replace With-> Latest from Repository command to get latest overwrited version.
Subclipse documentation is weak I could not find any good guide on the Internet. Could you explain subclipse conflict resolution step by step for a dummy like me? A video showing the steps, or an alien technology to fix it quickly will be fine. Are there any better (easier) solution for source control for eclipse?
(I use subclipse 1.4)
Yes, you are right. There is no button for that. in the Diff View(Side-by-Side View) the items in red are in conflict. They can not be automatically merged. You must review the item in conflict and manually resolve it by copying/editing the block of code that is in conflict.
After committing to or updating from repository(Synchronize with Repository) you'll see in the Console view that some items are in conflict. When you take a look at that file in Package you'll see 3 files right next to your original file:
myfile.txt (original file)
myfile.txt.mine
myfile.txt.r3293
myfile.txt.r3501
Right-click your original file then select Team -> Edit Conflict. In the Diff View provided, edit the file on the left-side to match the final result you want. (i.e. You may want to keep some of your changes and copy over new update from the revision in SVN, discard all changes and only keep your changes, etc.) After you are done, save the file. Right click your original file again then select Team -> Mark Resovled.
You will see that the addition 3 files disappear. You can now "safely" commit your work.
There is no easy way to do this since SVN can't decide what's the best option when such conflict arise.
I know this thread is old, but if someone is looking for an updated answer, my experience can help.
I'm using subclipse 1.8. Right-clicking on the original file and selecting "Mark Resolved...", you'll have several options, among others, take the local file or the base file as the correct version. You can save time with these options.
I can't find "Mark Resolved" so instead I clicked "Mark as Merged" after manually deleting the generated files.
Do the following steps:
Copy your latest working updates to a safe place.
Select the file which has conflicts..right click > select replace with>>Select Latest from Repository.
Then go back to your saved working copy and manually replace the current file contents (which has been overwritten in above step) with yours.
Then from team select Commit...
This way conflicts should be resolved and you saved your latest updates to SVN Repository.