R studio can't find GIT repository on UNC drive, but I can GIT BASH there - rstudio

I've got a git repository (an R studio project) on a drive (\ds\folder...) that worked fine. However, the admin of the hospital I work at updated my Windows version, and now when I open the project I see this in the terminal:
You can see that my repository is located on a network drive.
In Windows I'm able to just go to the directory of the project/repository, and Git Bash there, which gives me the following Bash terminal:
How can I get R Studio to also change the directory to the drive that my project is on? I've read on some solutions that involve mapping a local drive to the network drive, which I thought were hard to follow. I'm really not looking for a solution that would require me to do that manually every time I use the repository, because I do that daily.
Thanks.

Related

Need to Restore Desktop Files - Accidentally Deleted Desktop Directory Using Git Bash

I am new to Git and I did something silly.
I forked a repository from GitHub, then cloned it onto my computer using Git Bash. Long story short, I wanted the directory to be on my desktop but for some reason, I used rm -r Desktop and now all of my desktop files are gone.
I then cloned the repo to my Desktop and it's the only thing I have on there. I tried closing Git Bash since I did not commit any changes but my files are still gone and I am unsure of what to do.
How can I recover my Desktop files? I did not commit or push or do anything of that nature so I'd assume the changes are still local. Thanks in advance for the help!
TestDisk is a tool for recovering files which have been deleted.
Install testdisk
nter testisk into the command line, and the utility will start.
Select your partition to search in.
Select quick search or deeper search.
testdisk will output which files have been recovered and then you can decide to recover or not.
A tutorial on testdisk at the following link,
https://www.journaldev.com/36700/how-to-install-testdisk-on-linux-and-recover-deleted-files

Git: fatal: fsync error on 'sha1 file': Bad file descriptor

I'm using VS Code with Git - it's in portable location C:\_DEV\bin\git and is also added to Windows PATH so it works just fine with no remotes.
I have a OneDrive _GIT folder where I have some of my "remote" repositories, that sync between 2 devices (sometimes, I have it there mainly for backup purposes).
The error appears when I want to commit changes, only way to "fix" this issue is to restart the computer, so I'd like to find a way how to fix it properly. The problem is, it doesn't appear always and not for all repositories, it's pretty random.
I think it's because of sync from/to OneDrive. Is there a command I can run to fix the file descriptor? Or other way to prevent it?
git remote --verbose
git ls-tree -l HEAD -- a:\new\theme\assets\sass\main.scss
git show 97a333c5e7fce816dbb46a5c1235d69e61836726
git show HEAD:theme/assets/sass/main.scss
git add -A -- a:\new\theme\assets\sass\main.scss
fatal: fsync error on 'sha1 file': Bad file descriptor
Thanks to #edward-thomson.
I had same problem on my PC, where i mapped a folder under my homedrive to E:
C:\Users\myuserid\E-Folder\SomeGitProject
by sharing the folder, so i could shortcut it to
E:\SomeGitProject
Solution was to use the full path in CMD or use the shortcut to homedrive from git bash:
~/E-Folder/SomeGitProject
I guess your A: likewise is a share, that you can access with a full path probably also located somewhere under your homedrive.
I am posting late to help others get to the solution faster than I did. The actual culprit was elusive, and I tried everything from re-installing GIT to creating new repositories.
This happened to me in windows and it was due to a change in permissions in a parent folder somewhere.
The solution was to simply disconnect and remap the folder.
I have had this error a lot recently, and the above answers helped, but another thing that also seems to cause it is VS itself running.
Try closing VS, then doing a "Git Bash Here" from Explorer and using the command line only.
Once done you can then reopen VS.
I also have mapped my root webspace as a drive.
This is no problem until files are watched (like with npm run watch).
I faced same issue. I just resolved this issue with the following steps:
1- Close Visual Code
2- Open project on git bash command line
3- Commit the code again
I had the same problem with visual studio 2017. My solution was to close visual studio, then open Visual studio CODE and merge the files there.
Restarting VS Code works. A bit easier than disconnecting and re-mapping the folder (which also works).
I just had the same problem. In my case the problem was low disk space. Hope this helps someone.

git and Cygwin Paths with SourceTree

I have installed cygwin on a windows server, solely for use of ssh.
In addition, I've installed Git for Windows, having discounted the use of Cygwin git as it doesn't support the windows extensions.
I have a git ssh user which can login (via ssh) and can create the repositories under this user's home directory. This allows me to push to the server from OSX running SourceTree. In this case, the repository is located with: -
git#GitServer:Repos/Project.git
The actual path to the folder under cygwin is: -
/cygwin/home/git/Repos/Project.git
However, I want to be able to have the Repos directory placed directly at the root of the cygwin folder, not under a home folder: -
/Repos/Project.git
Doing this causes SourceTree to fail when trying to push to the repo. I'm defining the path like this: -
git#GitServer:/Repos/Project.git
I have also checked permissions on the folders and this is not the issue.
The failure results in this message: -
fatal: '/Repos/Project.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I can understand that I'd have problems if the repo was placed outside of the cygwin folder, but should it not be possible for it to be placed at the root and can anyone explain how I can get the SourceTree path to access the repo, if it's placed at the root, without having to create symbolic links?
So you have a directory with Git repositories placed in the Cygwin's root directory. I will expect, that your Cygwin's root directory is c:\cygwin, so directory with the Git repository is c:\cygwin\Repos\Project.git. Cygwin's root directory is mounted as / in Cygwin, so your Git repository directory is /Repos/Project.git.
SourceTree is native Windows .NET application, so it uses Windows file system and Windows style paths. Therefore if you said SourceTree to look for Git repository in /Repos/Project.git, it was trying to find it in c:\Repos\Project.git, which is obviously wrong. Just set it to proper Windows path in SourceTree and it will work.
It's the same for any Windows application. Cygwin's path is understood only by Cygwin applications. You can use cygpath to convert Cygwin paths to Windows and vice versa. This command for example opens current directory in Cygwin in Windows Explorer:
explorer `cygpath -wa .`
Also repository can be placed anywhere you want of course, it doesn't have to be under Cygwin's root directory. It can be even on a different drive. Cygwin mounts all Windows drives as /cygdrive/<drive-letter> automatically by default, so e.g. d:\Repos is accessible as /cygdrive/d/Repos in Cygwin. You can also create a symbolic link to any directory outside of Cygwin, so you can have e.g. /cygdrive/d/Repos linked as ~/Repos for faster access from Cygwin.
Just one simple rule: under Cygwin use Cygwin style paths, under Windows use Windows style paths.

SVN: Create patch from specific revision to head

I have a computer that is offline from the network, but shares some svn directories with computers that are on the network.
About once a month I need to update the directories on the offline computer with the changes that have happened in the repos. The current way I do this is to zip the directories, burn on cd and unzip on the offline computer.
I thought there must be an easier way to do this, so I thought of getting all the files that were changed from the last time and only zip those. But then I would miss out on changing deleted files.
So I there a way to create a patch from a revision to head? I've searched but haven't found anything useful.
Both computers run win7.
If you know the revision of the last change, you could run a
svn diff -r revision:HEAD
to get the list of changes on all files.
You could add --summarize to get a list of files alone (without the actual diffs)
svn diff --summarize -r revision:HEAD
which could then be piped into a zip command to just get the files that were changed.
Refer SVNBook
If the repository isn't too large and can fit entirely on an USB stick / CD, you can do this:
Create a copy of the repo on the USB stick / CD.
Plug the USB stick in the offline computer, and svn checkout the files straight out of the repo on the USB stick, using the file:/// schema (documentation).
Monthly, do the same process again, only instead of checking out from the USB repo, simply plug the USB stick and run svn update. If you've copied the latest version of the repo in the same directory on the USB stick, the update should run just fine.

How do I download an Xcode project From SVN?

I have been given SVN access to a repository which is in the form of svn://xxx/repo-name/trunk
How do I download the source code onto my local hard drive?
I have tried using the terminal on Mac with the following command:
#svn checkout svn://xxx:portnumber/repo-name/trunk
This does not seem to have helped.
I have also tried to use the Organizer in Xcode to setup the repository with no luck.
Also: if the project gets downloaded, is it saved in the root directory on my hard drive?

Resources