How to delete a git local repo folder in windows 7 - node.js

I have created git clone in local directory. Then I have run npm and also installed some node packages(gulp etc). But I don’t want now the working directory. So I just did right click mouse and delete, I am not able to delete. I am getting the below error.
"The source file name(s) are larger than is supported by the file
system. Try moving to a location which has shorter path name, or try
renaming to shorted name(s) before attempting this operation"
What would be the issue.

On Windows, this thread shows that it can be:
a path length issue (the path is too long)
a process issue (which keeps an handle on one of the files being deleted)
I found out make a drive mapping about halfway into the folder structure you should be able to delete the latter half of the file heirarcy.
For example if you are getting the error trying to delete:
\\NAS.Device.Company.com\a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
Then map a network drive Z: to
\\NAS.Device.Company.com\a\b\c\d\e\f\g\h\i\j\k\
This will reduce the file herarchy down to a smaller path.
Open explorer and view the Z: drive. It should contain a folder called L (in this example).
You should now be able to delete the L and its subfolders without an issue, thereby deleting half the folder hierarchy.
After that, disconnect the Z: drive and try to delete whatever is left normally.
Problem solved!

Related

How to move a Visual Studio Code workspace to a new location painlessly?

I thought VS Code saves all the relevant metadata in .vscode folder and .code-workspace file and as these are contained within the workspace folder I assumed it's all self-contained and shouldn't cause problems when moved. But apparently I was gravely mistaken.
After moving my workspace folder to a new location and altering folder paths saved in .code-workspace file accordingly all my opened editor panes and the bottom panel are gone. What I have now is a nice Welcome window.
I'm aware of what the official guide recommends, but that's only moving .code-worskpace metafile - the folder still stays in place.
I've just run into the same issue. My workspace wasn't saved to a file at all (I just use the "Open with Code" option on each project folder), and the Save Workspace As option didn't help as it just created a JSON file with a couple of empty objects in it (which probably makes sense as I haven't really modified any workspace settings, I just want to preserve my open editors and things like that).
On Windows at least, it seems that those kinds of "workspace" settings are actually stored within subfolders of %APPDATA%\Code\User\workspaceStorage, and an SQLite database file is used to store the actual settings, so this is what I ended up doing:
Move your folder to the new location on disk (close all VS Code windows first)
Open the new folder location with VS Code (you'll just get the Welcome tab at this stage, but we just need it to create a settings storage folder for the new location). Then close VS code again.
Open %APPDATA%\Code\User\workspaceStorage in File Explorer, go into each subfolder and open workspace.json (in any old text editor). In my case at least, it only contains a folder property, which is path of the folder that this settings folder relates to (but just changing this won't help us at all, it was the first thing I tried). Use this to figure out which of these subfolders relate to the old and new paths.
Copy state.vscdb from old to new, and delete state.vscdb.backup in new.
Open state.vscdb in new in some sort of SQLite database file editor (I used DB Browser for SQLite and it worked fine, but there's also SQLiteStudio which looks like it might be better in general).
Run an UPDATE query to update all the paths in the database. They seem to be stored in three different formats/levels of escaping - between folders there can be a forward slash, two backslashes, or four backslashes. In my case I wanted to move my project folder from the root of my Windows user folder into my usual documents folder which is within OneDrive, so my query was along the lines of the following, as I only needed to change the middle section of each path. You might have to do something more complicated if you are moving to a different drive for example (would need to have a look at all the existing paths in the database to see how they are encoded).
UPDATE `ItemTable` SET `value` = REPLACE(REPLACE(REPLACE(`value`, 'User/Project', 'User/OneDrive/Documents/Project'), 'User\\Project', 'User\\OneDrive\\Documents\\Project'), 'User\\\\Project', 'User\\\\OneDrive\\\\Documents\\\\Project')
After saving the database, I just opened the new folder in VS Code, and everything seems to have loaded up exactly as it was in the old location :)
(Also just in case anyone is curious, the subfolder names in workspaceStorage seem to be some sort of hash based on the path, because if you delete the subfolder that relates to a folder you've previously opened in VS Code and then open that folder in Code again, it recreates the same subfolder name. So that means just updating the old workspace.json and database file in-place won't work)
Scenario 1 - Moving the .code-workspace file The xxx.code-workspace file that defines your project folder location(s) is in JSON format. It has a "folders" section and a "settings" section. If you just mant to move the location of the xxx.code-workspace all that is needed is to go to File->Save Workspace As..., browse to the new location, select the name you want to give the workspace and it will save it with a .code-workspace extension. All of the "path" entries in the "folders" section are changed to a path relative to the new location.
Scenario 2 - Moving the entire workspace. If you want to move the entire workspace to a new location and the .code-workspace file is in the root directory of your workspace, just move the old workspace to the new location. The contents of the .code-workspace file will still be correct. Just select File->Open Workspace..., navigate to the new location and open the .code-workspace file.
Scenario 3 - When you .code-workspace folder is stored in a different location. If you store all of your .code-workspace files in a location apart from the actual workspace, the simplest way to move the workspace is a two step process:
With your workspace open, do File->Save Workspace As... and save the .code workspace file to the root directory of your workspace.
Move the workspace to the new location.
File->Save Workspace As... and save the .code workspace file to its location.
Close VS Code and delete the .code-workspace folder that's in the root directory of your resource, so that future settings changes will be saved to the correct workspace.

Unable to delete renamed folders

I was renaming several files/folders when VS decided that would be the perfect time to crash. On re-opening, I now have 2 versions of the folders I renamed, one with the old name and one with the new. The new folders were not linked to source control, so I added each of them. Now, when trying to delete the old ones, I get the following error:
This operation cannot be completed. You are attempting to remove or delete a source-controlled item where the item is exclusively locked elsewhere or otherwise unable to be deleted from source control.
I know no one else had those files checked out, and all the files in them have the little green + as if they are new files. I can delete all those files so the folder is empty, but I still cannot delete it. I'm also unable to exclude the folder from project.
If I open a file explorer, I can delete the old folder and then VS will allow me to delete the folder. However, when trying to rename one of the folders back, it gives the error above, even though the folder had been deleted.
My internet searching powers are coming up short and I'm not sure what else to try. Any ideas on how I can fix this?
In case it matters, the affected folders contain .cs, .cshtml, and .js files. The OS is Windows 10.
Generally the files/folders are not really deleted from TFS as they are in source control, unless you permanently destroy them, See Destroy Command.
Files and folders under version control can be easily moved, renamed, and deleted from Source Control Explorer. (Make sure you have these folders mapped in your workspace.)
Just check and try below things:
Note that you cannot delete a folder that has pending changes on any
of its children (including if any of those children are being moved
out of the folder – they’re still children until that changeset is
checked in.)
So, in this case you need to move the children out of the folder
and check those changes in, then delete the folder as a separate
changeset.
Besides in earlier version of TFS and VS have some problems with
deleting empty folders. In this case you can try creating an item
inside the folder you are trying to delete. After that try
deleting again. See this article for details.
You can also try to delete the renamed folder from the command line.
Se Delete Command (Team Foundation Version Control) for details.
Get latest first, then try deleting again.
Remap the workspace or create a new workspace and map to a new
location, then try deleting again.

How to view changes after "Get Latest Version"?

When I Get Latest Version I often want to see what files have changed (and the diff). How do I achieve this with the least amount of IDE navigation?
Best thing to do is a folder comparison before you get the latest version. In Source Control Explorer, you can compare the differences between two server folders, two local folders, or a server folder and a local folder. Right click on the target folder and select Compare. Read more here.
This is only a solution to part of your question "what files have changed".
Once you GetLatest, go to View -> output window or (CTRL + W,O). This will show you the list of files that was replaced in the last GetLatest operation. Once you have the list of files you can do file comparison on each file to get the changes.

Installshield : How to preserve files after uninstallation

I am using installshield 11 to create Basic MSI Project. My requirment is, when i unstall the project, i want to preserve certain files.( I don't want these Certain files to be removed when unstallation takes place ). Morover, these files are not a part of the component, but they are created(copied) during installation process by using copyfile (script) command from specific location.
-Dev
Use Disable(LOGGING)....Enable(LOGGING). Using CopyFile() in-between these methods will prevent uninstall removing the files
Windows installer removes only those files and folders which it installs. That is each file present in it's database in File table and Folder table. It do not remove any file which does not have entry in File table, similar for folder.
Also, If folder is not empty then that folder does not get deleted during uninstall.
If your installing some files using Copyfile script ( may be using any custom action) then those files will not be removed during uninstall.
Thanks Balachandra for your response, But i have below observation which might help.
Files which i want to preserve is created by CopyFile, and target dir which i mention in the copyfile command does not exist. So CopyFile creates the folder and copy the file to that folder. So obviosly we will not have this folder entry in the dir table of installsheild
But this approach does not help, uninstallation is removing all copied files from this folder.
-Dev
Thanks, Alerter, I've been fighting this one for 2 days.
We install an example configuration file and create a copy of it (on first installation). We needed to preserve the configuration file if the customer changed it, but the file was always getting deleted on uninstall. Disabling the LOGGING around the CopyFile command was exactly the solution for this situation.
Dev, I know this is an old post, but you should accept this as the correct answer.
Hopefully this phrase will help others find this solution easier through the search engines: Installshield file created with CopyFile is always deleted during uninstall

Out of date error message on tortoise

I am trying to commit a file that is out of date. I tried cleaning the directory and nothing is working... the most recent file on my local machine is the one i know i want to use.. what is the standard way of overriding the conflict... should i just delete and re-add or is there another way "resource is out of date try updating"
UPDATE BASED ON ADVICE TO UPDATE*** I am getting a "checksum mismatch" error
You need to update your local copy of the file. Right click and click update.
Any changes that have been made since your last update will be merged with your current copy. You can then right click on the file and select resolve conflicts.
If you want to ignore any changes that were made and just use your local copy, the easiest way is to copy your file to another location, update, then overwrite the file with your local copy. However you usually will want to let Tortoise handle merging any changes for you.
Did you try an update? You need to update your local copy to the current version in the repository. Right click, and select 'update'.
I had the exact same issue, it turns out that there are hidden folders containing data that tortoise uses to maintain some record of changes that have been made. If the data in your local folder does not match the data in the server, then you get a whole lot of errors that make very little sense.
To fix this, Right click on your folder and click "SVN Update".
IF you still get an error, open your local folder in explorer, enable viewing of system files and hidden files, and look to see if there is more than 1 hidden .svn folder inside your local directory.
In my case, I had accidentally copied another .svn folder into my local directory. This extra .svn folder was causing the update errors. There should only be 1 .svn folder in your root directory.
Delete the extra .svn folder (usually only the local root folder has the .svn folder) and try updating again.
Tortoise should update your local copy and then you can commit your changes without a problem.

Resources