Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT tracks changes occurred BEFORE it was installed

Tags:

git

eclipse

Maybe I have hallucinations, but I'm pretty sure of what I'm saying (I am new to GIT): I have some java code on my local drive, never versioned (to any versioning system, neither GIT nor SVN or whatever). I've created a repository on bitbucket, then I imported the source code from local drive. I did some testing, following a tutorial. Everything worked fine since I've noticed that, in the history folder (I am using the Eclipse plugin) I could diff two older versions of a file (and have the correct diff displayed), but these changes were made BEFORE I even created the git repository (local and remote).

I cancompare two versions saved yesterday:

I![YESTERDAY][1]

I can compare two more recent versions (today):

![TODAY][2]

-- I cannot post images, not enough reputation :( --

Notice that I installed GIT (and created the bitbucket repository) TODAY!

like image 542
Diego Pascotto Avatar asked Jul 01 '26 19:07

Diego Pascotto


1 Answers

It's Eclipse tracking the history. I have a toy Java project open in Eclipse—which has not been commited to any source control—and I am able to diff against previous versions I saved yesterday.

To see for yourself:

  1. Create a new Java project
  2. Create a new class file
  3. Make several changes, saving each time
  4. Compare with > Local history...
like image 63
Chris Throup Avatar answered Jul 03 '26 08:07

Chris Throup



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!