Using TortoiseGit on admin folders - windows

Can tortoise git be configured to use admin privileges on Windows?
Background: I work with project on Windows that is maintained with git, however with the project is compiled the build process sets the folder it is cloned to is set to an administrative folder in windows due to reasons beyond my control (tools that are compiled only work in admin mode). This creates an issue in that the contents of the folder that is cloned, and the .git subdirectory and all it's children are not writable to the normal user, unless the user elevates to admin temporarily.
Rather than prompting to use 'admin' tortoise git seems to just bomb out and report that the files cannot be changed as they are read-only.
Is there a way to get tortoise git to either use admin privileges all the time, or at least prompt to use admin if necessary?

Related

Cant clone git repository

first-time asker here. I have an issue with git, cant clone anything. If I don't specify where to clone, this will appear.
> git clone https://gitlab.corp.cz/username/project_name.git project_name
fatal: could not create work tree dir 'project_name': No such file or directory
If I first create a folder via explorer, then the error message is different.
> git clone https://gitlab.corp.cz/username/project_name.git project_name
Cloning into 'project_name'...
C:/Users/username/Documents/project/path/.git: No such file or directory
Mkdir say the same, though not sure if windows even have a mkdir. At least a month ago, it worked. Please help, even reinstalled windows, didn't help.
EDIT: It looks like it is not a git problem. I cannot create any file using nothing other than windows explorer. Checked and I have write permissions for this folder, so most likely a windows problem.
a) You must run the command in a directory where you have write permission;
b) Add git to the list of allowed applications:
1 - Select Start > Settings > Update & Security > Windows Security > Virus & threat protection.
2 - Under Virus & threat protection settings, select Manage settings.
3 - Under Controlled folder access, select Manage Controlled folder access.
4 - Switch the Controlled folder access setting to On or Off.
c) If that doesn't work, try running the terminal with the administrator.
If you are using WSL (Windows Subsystem for Linux) to execute this command in the terminal check if the linux user has permissions to create a new folder there or try doing it as root.
If you are using Powershell or the Command Prompt try running it as Administrator and check if cloning a repo will work.. if this works there is a problem with your permissions. In this case try to change your working path so if the folder you are trying to clone a repo is in "C:\Program Files" or "C:\Program Files (x86)" try cloning to another place as these paths cause problems.

Git for windows setting different permissions on files in same repo

I have a local repository on my host machine. I need to clone this repo from the host machine to a vm running debian. Folders are shared, files are accessible.
But git seems to set different permission for different parts of the repo.
So while most files have my windows user set to Full control, the individual files in ./.git/objects//* have just the SYSTEM/Admin/Administrator permissions and not my windows user. Mind you, the folders in ./.git/objects/* have my windows user set, but the files within not.
Because of this git clone fails for these files. Is there a way to tell git to add my windows user to any file it creates?

Permissions and SVN Updates on Windows Server 2008: same folder & SVN account, different Active Directory users

We're experiencing strange permission issues with SVN after switching from Windows Server 2003 to Server 2008.
On our standard build box there is a folder (C:\SVN_Code_Folder) which AD_User_A associates with a SVN repository using SVN_User and TortoiseSVN 1.7.6
When using Windows 2003, when AD_User_B logs into the box and tries to Update, Switch, Merge the SVN_Code_Folder with SVN_User, the command is executed.
It Windows 2008, it fails with the message:
Command: Update
Error: Working copy 'C:\jboss-4.2.3.GA\server\New folder' locked
Error: sqlite: attempt to write a readonly database
Error: sqlite: attempt to write a readonly database
Completed!
Attempting to unlock the file, which was never locked, via the context menu is met with the following message:
There's nothing to unlock. No file has a lock in this working copy.
I've played with the permissions of the folder and I've discovered that giving "Domain Users" control over the folder fixes the issue, but I would prefer to not have such a broad permissions. I've tried granting the same permissions to individual users and a SVN-group, but these too did not work.
What am I missing?
Is this an improper use of SVN?
Can 2 different Domain users update a folder using SVN without removing the .SVN file?
For future reference...
I had this same problem with some WC's that I copied over to my new laptop's hard drive, from a file share on my old machine.
It turned out that the problem was solved by giving myself (as opposed to all domain users, or any other group) full control over the folder.
Did you check the svn service user on the win2008 machine?
Does that user have local administrator privileges and also have permission to these folders on c:?
After changing anything restart the service.
For me change folder permissions did't help, but I have update for several directories in a batch script so I solved this by
cmd -> Run as administrator -> start update script

Mercurial: How can a user clone another user's repository on Windows?

I have two users A and B on a Windows 7 machine. A has a Mercurial repository named Foo in a directory where both A and B have read-write access. When B tries to clone this repository he gets this error:
D:\Code>hg clone Foo FooClone
abort: D:\Code\Foo\.hg\requires: Access is denied
What is the cause of this error? How does a user clone a repository created by another user on the same Windows 7 machine?
You might decide this is too restrictive compared to cloning directly from the file system, but you could set up a web server on the machine, and have each user set up a directory containing repositories to serve over HTTP. Once the infrastructure is up and running, it should be no more difficult to use this setup day to day, and you won't run into file system permission problems.
icabod may be right about permissions, but this may instead have to do with ownership. User A may own those files, even though they're shared with B.
Try running the commandline console as Administrator.

TortoiseSVN Commit htdocs?

Trying to version control my project that's sitting in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs using TortoiseSVN. I can't commit it though because Tortoise doesn't have permission to create the .svn file in that folder (anywhere in Program Files?). How can I get around this?
Set the permissions on that folder accordingly:
right-click on folder, chose "properties". The "security" tab shows you which user has full access - add yourself to that list.
After that, you (the logged on user) have full access to that folder and you can checkout/update without problems.
Please do not run Tortoise or explorer in Administrator mode!
Run Tortoise as Administrator mode.

Resources