svn, can't remove a directory - linux

I am on Fedora 17 trying to use svn version 1.7.6
I have created a repository at /home/el/svnworkspace and I checked out a working copy in /workspace
I am getting this error when I use the command:
[root#defiant workspace]# svn remove TestProject --force
Gives the Error:
svn: E155035: '/workspace/TestProject'
is the root of a working copy and cannot be deleted
The error message is partially right, TestProject was a root before. But I deleted it and now /workspace the root. So somehow it is confused. I no longer want TestProject to be a root, and I want workspace to be the root. svn is confused, and I want to unconfuse it, maybe one of you know the proper wizard incantation to remove /workspace/TestProject as a root of a working copy? I just want it to be a normal folder again.
Perhaps the only way for me to fix it is to blow everything away and re-add everything. Maybe a resident wizard knows a better way.

SVN does get confused about directories sometimes.
Unless you have a lot of changes you need to check in, I suggest removing the hierarchy in question from your filesystem (rm -rf), and checking out again starting from wherever looks appropriate. This always seems to handle SVN directory confusion for me.

I was able to fix the problem with these steps:
Make sure nothing has a lock on the files in question, for me: Eclipse IDE. So close any IDE's or Editors that might have a lock on the file.
Make sure you have write permissions on the working copy as well as the repository.
chmod -R 775 /workspace
chown -R your_user_name.your_user_name 775 /workspace
chmod -R 775 /home/el/svnworkspace
chown -R your_user_name.your_user_name 775 /home/el/svnworkspace
If you are using a program with a GUI like rapidsvn to add/remove/commit files, turn that off and use only the command line svn command. The GUI might have been have been conflicting with what I was trying to do on the command line.
finally, I think this part is what fixed my problem:
Go into the directory that I want to add, but won't add. Manually rm -rf all the .svn files in it. Then try to svn remove it then svn add it. It successfully adds and then I could commit it and all is well.

Related

Weird recursive directory structure

Somehow, my system (Ubuntu WSL layer on Windows; so treat as exactly Ubuntu) went a bit crazy. For a directory (a git repo if it matters) /path/to/foo, running ls shows the git files ORIG_HEAD, index, and index.lock in there.
I tried to debug this by going cd .git, but an ls there showed me my same list of files as the parent!
I went as far as
/path/to/foo/.git/.git/.git
before stopping checking the recursion.
A possibly related issue that managed to show up is that the .htaccess file there is read as a file by Emacs on Windows, a file by vi on Linux, but a directory by emacs and a directory by bash.
That means that my computer really thinks
~/public_html/.git/.htaccess/.htaccess/.git/.htaccess/.git/.git
is identical to
~/public_html
So, needless to say, Apache also craps out and says that it's an invalid htaccess file .... though on an other machine (see: git repo) it runs just fine.
Help?
Tried nuking the directory via rm -rf and git clone-ing back, but the Apache problem persisted.
I removed the symlink to the directory via unlink:
~$ unlink public_html
then re-mounted it, making sure that there wasn't a trailing space
~$ ln -s /mnt/c/Users/USER/pathto/repo /home/USER/public_html

Remove a git fork on server

For school we use git to submit things. Every question here seems to be dealing with GitHub and isnt answering my specific question.
In our lab we were attempting to download the files but the prof was having issues on his end. He was asking me to try some commands etc. Anyways we did this:
ssh csci fork csci/Labs csci/$USER/Labs
git clone csci:csci/$USER/Labs
And it worked but the files had issues or something. He said he will get the sys admin to fix it. Then today he told me I need to delete my version on the server and just do it over again. I asked if I can just rm -r the folder but he said I need to delete the one on the git server - he said he doesnt know the command but I should be able to look it up.
I tried
git remote remove csci/Labs
but that did not work. I already deleted the local folder (before he told me about it actually) using rm -r Labs, and saying yes to the delete this git file warnings or whatever. So Im not sure where to go from here to delete it.
A repository is just a directory with working copy (though it is optional) and .git, so deleting the directory deletes the repository. To delete a remote repository you need to have access to the remote filesystem.
Try to run which should work also.
rm -rf .git

Use a git repository on /var/www/html/

I am making a web tool and hosting this project on Github. I want to create a repository on my machine (running linux) being able to easily test it on local.
I can test it without problems on /var/www/html (already have apache and php set up), but I am having trouble creating a repository there. However, if I try to create the repo in ~/Documents/Github/PROJECT_NAME it works perfectly; but I can't test my project from there.
How can I create a repo inside /var/www/html where I can put my project files and run them locally without problems?
I tried to run sudo git init then sudo git clone git#github.com:xxx/xxx.git (that is how I clone my repo on ~/Documents/Github/PROJECT_NAME, so I have already exchanged SSH keys with Github) but it didn't work:
Cloning into 'PrerequisiteVisualizer'...
Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
EDIT: I am able to run without problems
mkdir ~/Desktop/TESTING
cd ~/Desktop/TESTING
git init
git clone git#github....
My question is similar to Attempting to use symbolic link for var/www/html but it still is different.
EDIT2: I think I need to clarify why the thread I cited isnt what I am looking for. I saw the solution proposed there but note that, as long as I understood the other thread, they created a directory in his home (~) and made it accessible locally using the per-user web directories. But this is not what I want to do. I just want to "create a repo inside /var/www/html", not in anywhere else.
The problem isn't strictly with /var/www/html, it's with sudo. If you use sudo to do git, you are running it as a different user, which doesn't have access to your private ssh credentials (nor should it have).
In the other thread you pointed to there's an explanation of per user www directories, which should be one way of solving your problem. If it doesn't, you could amend the question with reasoning why it doesn't.
Update: based on the discussion, you want all content within /var/www/html owned by the user operating git repository. That you should be able to do in the way proposed by #rogerovo in a comment to this answer:
sudo chown -R _currentuser_:www-data /var/www/html && chmod -R g+sw /var/www/html
Permissions for /var/www/html folder needs to be changed.
Kindly run this command sudo chmod o+w /var/www/html to give write access to everyone.
Once run, you should be able to transfer files in /var/www/html folder.

gitweb not loading repositories through symlinks

I have gitweb on localhost and a sample project for which I've executed the git init git add and so on. I create a symlink with sudo ln -s /media/dir/project/.git/ /var/cache/git/project.git but it doesn't work and I still get 404 - no project found at localhost/gitweb.
The only way I can only bring the project info titles such as description, ..., then without project info, only the 4 sorting options, is to copy the git physically to /var/cache/git/project.git/ though some files won't be copied. This is the only way I could only not receive the not found error.
I manipulated the /etc/gitweb.conf and /etc/apache2/conf.d/gitweb in anyway, but it didn't help.
(I'm using apache 2.2 under Kubuntu 11.10)
Thanks so much for your helps!
Check the permissions on all of the directories in the symlink path. Whatever user your cgi is running as needs at least +x on all the parent dirs and +r on the .git directory and files.

Fixing permissions after FTPing ASP.NET code to a Linux system

First off, I'm running Mono to run ASP.NET on Linux, but that's not the question.
It appears that, every time I clear out my application directory and upload, I have to go back in and fix the permissions. What I'm doing is
chmod -R -c 755 /var/www/*
...and there are two questions.
What's the deal with having to do this every time I FTP? Feels flaky.
Is there a better permissions set than 755? Do I want different permissions for the /bin directory? Or can I fix this all with one fell swoop of chown?
It could depend on your FTP server and configuration. I always used this and it worked:
chmod 777 /path/...

Resources