Local History and Updates

Answered

I see a post on here from 8 years ago requesting this.  Local History is easily in the top 3 features, available in Intellij, but if we update, it's gone.  

Question:  I've copiéd out the library/caches/google/andstudioversion/local history folder.  Is there a way to use these, in the IDE if I update.  I read in one 8 year old post, that they are closely associated with the ide caches, but I think that they aren't so closely anymore, since you can invalidate and keep history.  Any clarification / idea of how to preserve these through updates would be greatly appreciated.

I use Android Studio, and I've updated my IDE 3 times since starting, with my current company.  I started on Feb 1.  6 weeks ago.  And there is another update sitting there.  I'm in the middle of a major refactor across a PR with 86 files changed, and my IDE's autocomplete is acting janky.  I wanted to update, but I can't until I get this working, only because of local history.

2
6 comments

Local history should be kept during the update. 

Here is the directory where local history files are stored: https://www.jetbrains.com/help/idea/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#system-directory

It is better to use Git (or another version control system) to store a backup of your code. 

1

It has been removed once in the last 2 month I know.  Not by my doing, so I assume from update.  Since that's the only thing I know of that would delete it.

We use Azure for version control, but when you have multiple iterations for multiple screens, with each screen spanning 5 or so files.  Experimenting with StateFlows vs LiveData and different things like that, that shouldn't be pushed up to the remote repo.  Local history is my go to, rather than making multiple experimental branches locally.

I got the PR merged in, so I'm going to update now.  If the history isn't preserved I will make sure to comment back.

0

History was preserved throughout a minor version update.  That makes me wonder why I lost local history about a month ago.  I may have rm -R ed the .gradle cache, but I don't think that would affect the local history.  Puzzled a bit.

0

Local history could also be removed when "Invalidate caches" action is fired: 

0

I can confirm that upgrading PyCharm from 2023.1 to 2023.1.1 did not wipe my local history. I do periodically lose all of my local history across all of the IDEs, I assume for example when upgrading from 2022.3 to 2023.1 (and likely from 2022.2 to 2022.3, as it certainly happens more frequently than once a year). If this is not the case, then something else is causing it, and I never check that box on the rare occasions that I'm forced to invalidate caches. 

0

Sid, we have the corresponding request to keep Local History while updating, please, consider upvoting it if you're interested. 

Please, note that minor updates (2023.1 to 2023.1.1, etc) don't create new IDE folders, but major updates (2022.3 to 2023.1, etc) create separate folders for each new IDE version.

1

Please sign in to leave a comment.