Make TortoiseGit not work on specific folders - windows

I have installed TortoiseGit on my Windows PC.
There is a directory on my pc (C:\SomeRepos), that has several git repositories underneath it. Those repositories are deleted or created by a script that runs on my PC based on some rules.
It seems that there are several times the script fails to delete the directory of a repository and I suspect the reason might be that tortoise also works on that directory as well.
I want to use tortoiseGit for all of the repositories on my PC, but I do not want it to interfere at all with the directory C:\SomeRepos.
Is this possible? Is there any good workaround?

You can define exclude lists and directories in TortoiseGit settings:
https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html#tgit-dug-settings-overlay
You could also change the way to overlay icons are calculated by setting Status-Cache to Shell or Shell-Extended.

Related

How do I stop OneDrive from downloading git.exe on Windows?

I have used Git on Windows for a while, but recently changed the setting and got this.
On almost every command for Git Bash (also on PowerShell and Github Desktop) I get
git.exe is being downloaded on OneDrive
(translation may not be exactly the same)
The setting that changed recently is moving my repos to a OneDrive folder in order to have them synced between two sessions: that is work desktop and remote virtual machine.
I can see that this may not be ideal, but it really works for me since I have the same settings on both sessions, and not really get used to doing many commit-push-pull. Not the main topic here, but feel free to comment.
(Edit): Upon reading solution, there are other ways to set this syncing that doesn't mess up with the internals of Git. Look for that instead. Thanks.
In any case, the strange thing is that the notifications happen only on the Remote Virtual Machine, but not on the desktop.
I have seen some notifications about some files in the repos, which I then attribute to OneDrive being nosy about every move I make file I move. But then I've also seen files I don't know about, and theres always git.exe attached to the notification.
In the first scenario I have tried tuning down the notifications for OneDrive. Some might say Microsoft does have a background for not letting users setup their notifications, so I'm still looking.
Thanks.
Most file syncing tools like OneDrive and Dropbox operate by syncing data file by file. This is a great approach if you're working on a single word-processing document or spreadsheet. However, it's not as great when you're working with a Git repository.
When changing between branches or making a commit, Git changes and creates a lot of files all at once. In order to be synced correctly, all of the created files must be written in a similar order: all the blobs must be written, then the trees, then the commits, and then the refs can be updated. If you do this out of order, your repository can be corrupted, since you can have branches that refer to objects that don't exist (or objects that refer to other objects that don't exist).
In addition, these tools can end up deleting files you wanted to have in your working tree or recreating files you didn't. So overall, you don't want to sync any Git repository using one of these tools.
You can write a bundle file with git bundle and sync that, or you can use rsync to sync a repository provided it's idle (not being modified) when you do. Note that if you sync a working tree, Git will need to refresh all files when you sync it across to the new machine, and also Git doesn't try to defend against untrusted users who have access to the working tree.
It's also not a good idea to sync your Git installation itself via OneDrive, which is what it sounds like might be happening. Instead, install Git for Windows on each machine independently and don't try to sync it across. OneDrive should have configuration options that let you control what's synced.

TortoiseGit showing up-to-date versioned files as non-versioned

I have a large VS2017 solution that is stored on GitHub. In my local working copy of the repository, there are several files that are marked with the ? icon overlay which indicates that they are non-versioned files. However, these files are in the repository and are up to date. If I commit changes to other files, these files do not show up in the No Versioned list or if I create a clone of the repository from GitHub, these files have the proper icon overlay.
Any ideas why these files are shown as Not Versioned in one local repository and not another?
Please make sure that the case of the filename on the filesystem match the casing in the repository.
Background
Even if Windows ignores the case in paths, Git does not (completely) - even if you enable core.ignorecase. git status indeed does ignore the case, however, if you try to get the log on a file with a different casing, the log will be empty.
Because of this in TortoiseGit 2.4.0 the icon overlays were made case sensitive. So if the overlay icon shows that the file is versioned, the log won't be empty and if the file is shown as unversioned you get an indication that something is curious.
How to fix
Rename the files in the filesystem (some applications might tend to delete and re-create the files with different casing) OR use the TortoiseGit rename function to fix the casing in the repository.
Since TortoiseGit 2.5.0 you can configure TortoiseGit to ignore the case when calculating the overlay icons again by enabling the advanced option OverlaysCaseSensitive (cf. issue #2980).

Recovering Single User Single Machine Mercurial repositories

I use Mercurial (from Tortoise HG) on Windows as a Single User, Single Machine Version Control system. I had the directories of all my repositories backed up.
On a new machine, I copied back the directories. I also installed THG. THG doesn't seem to recognise the directories as repositories on it's own. i.e. in Explorer I don't see the checked out/committed icons on the file names. If I right click on a file, and go to the THG options, it does show me revision history etc. When I do open Repository on THG and point it to the directories, it does again show info.
How do I make it see the dir as a repository from Windows Explorer.
Also I haven't yet tried changing files, committing etc, no idea if it would work.
Seems like your only 'problem' is that you don't see the overlay icons in the Windows explorer shell. Otherwise everything's ok.
You can try to simply close/reopen explorer. If that doesn't work, a system restart will do in any case.

.bashrc in the cloud?

I do alot of development from the terminal at both work and home. What's a good solution for keeping all of my .bashrc, .vimrc, .screenrc, Irssi configs and scripts, etc. in sync across multiple machines?
I was thinking of setting up a hook in my .bash_login to go into a ssh into a central repository and rsync everything, but is there a better way?
One solution I have seen used by a number of my friends is to put all of their configuration files in a source control repository like Github which can use your home direcoory as their working directory.
Then all you need to do is pull from the repository and all of your rc files will be up to date. Committing changes from any of your machines and pushing them allows you to make those changes available everywhere.
In order to deal with variation among versions or paths between machines you can either use multiple branches(or tags depending on your choice of revision control) or just use the building in condition abilities of your config files (at those which support such things).
Put your config files in your Dropbox folder, and symlink to them in your homedir.

How to move files from svn folder to production server

I have a website written in PHP under source control (SVN). I would like to move at once all my files from the website directory to production server.
The problem is that in this folder there are folders of SVN (.svn). The second problem is that i do not want to put on the server only files under source control, but also other in this folder (images, css, and so on).
Could you please tell me how to do this? It would be nice if it would be repeatable - that so I would have only one command to execute.
And if there would be any possibility to optimize uploading (not uploading not changed files) to make whole process of going production faster would be nice too.
EDIT:
My development environment is Eclipse PDT and favorite FTP filezilla.
You can use the export function of subversion, this will allow you to export all files under version control, but also all files NOT under control. Both methods will skip the .svn folders.
You didn't mention your client, but Tortoise has the 'export unversioned files too' option.
See here for commandline syntax
You can use an ftp client if it's support filters (exclude .svn folders, i.e FlashFXP).
Currently I'm using Nusphere PhpEd IDE's built in feature called "Smart upload", so it only updates changed files (with modified time changed).
I use rsync which is a fast command line tool which only sends the changed parts of files. You can set it up to exclude .svn directories as outlined here:
If you wish to continue doing this with fileZilla you can go to View->Filename Filters and select to ignore SVN and CVS directories. You can also only upload changed files with FileZilla however I find rsync far faster. As rsync is command line based you could easily hook it up with Eclipse as an external tool to enable 1 click transferring
You can use springloops, they cover SVN commit and checkouts but most importantly deployment to FTP server with a click of a mouse...
I stumbled recently on the same issue running Ubuntu 9.
In FileZilla you can choose ignore filters which contain even presets to prevent copying .svn folders and windows .thumb files! You can find this in the View menu under Filename filters... Works like a charm!
Thumbs up for the FileZilla folks!

Resources