git svn clone fails with HTTP path not found on moved svn trunk - git-svn

I'm using git svn to access an svn repository. The svn repository was recently re-organised, with the trunk and a branch being swapped around i.e. trunk was moved to branches/old-trunk, and branches/foobar was moved to trunk.
Running svn co http://path/to/svn/trunk works fine on the new trunk, and I can add, update, and commit files without any problems.
However, when I do git svn clone http://path/to/svn --stdlayout I get the following error:
HTTP Path Not Found: The path was not part of a repository: PROPFIND request failed on '/': '/' path not found at C:\Program Files (x86)\Git/libexec/git-core\git-svn line 2299
Does anyone know how to get git svn working again?

It turns out the issue was being caused by accessing the svn repo from behind a proxy.
As well as my machine-wide proxy settings, I'd also got a http-proxy-host set in my ~/.subversion/servers file under the [global] section, and the two settings seemed to be getting in each others way.
I commented out the http-proxy-host settings and was able to run git svn clone without any further issues.
TL;DR user error

Related

Capistrano, Git, and Rails. (Reset hard head)

So I had been (stupidly) making changes directly on the live server instead of making them on my local machine and deploying them. This messed up my deployment. So now I was to do "git reset --hard".
On my remote server I have a project.git directory (for the repository... which is bare btw) and a project directory (for my actual application).
But when I try to run "git reset --hard" it tells me I'm not on a working tree. If I go into config and change bare to false... it says the same thing.
Ideas?
Found a better solution. :)
First I did a git reset --hard on the local server (since the remote server is just a bare repository.)
Then I did a git commit -a which told me there were no changes but that there were untracked files.
So I did a git add . to add all the files that weren't being tracked.
Finally I ran git commit -a again and git push.
This updated my repository with all the new files and then cap deploy functioned as expected.

history not preserve while move svn to GIT (for svn Move folders)

I have an SVN project with a structure as specified below:
PROJECT > trunk, branches, tags, subproject1, subproject2, release notes
I have restructured the project through the SVN MOVE command so it looks like:
trunk, branches, Tags. (moved the folders into trunk).
I'm able to see history preserved as I moved through SVN MOVE command.
Now, I have migrated the SVN repository to GIT through below command,
$ git svn clone --stdlayout --authors-file=authors.txt file:///svnrepos/local-svn/PROJECT project.git
NOw, In the GIT repository, I am not able see the history for moved folders and it only shows me last "svn move" command history. I can see history for all other files which are not moved.
Please let me know your comments.
Thank You.
SVN Move will not be able to preserve the history while moving to GIT as it will consider as new directory entry commit in GIT.
there is require to use SVN-DUMP-RELOC which will restrcutre the directory in SVN DUMP file instead of repository.
Please follow the steps mentioned in below link for windows machine:
svn-dump-reloc use in windows command prompt
Thanks

How do I change ignore-paths on an existing git-svn repo?

I have an already existing git-svn repo with an ignore paths in my .config file that looks like this:
ignore-paths = ^(?!(Path1/Proj1|Path1/Proj2|Path2/Proj3))
This works well.
Someone added a new project in svn that I now need in my git repo.
If I change ignore-paths to what's below and issue a fetch or a rebase, I never see Path2/Proj4
ignore-paths = ^(?!(Path1/Proj1|Path1/Proj2|Path2/Proj3|Path2/Proj4))
In the past, I've always given up and blasted away my git repo and recreated it. Is there a better way?
After editing the ignore-paths you need to
git svn reset -r <n> -p # where <n> is the SVN revision where the new path was added.
git svn fetch
git rebase # or reset
Reference git-svn(1):
reset
Undoes the effects of fetch back to the specified revision.
This allows you to re-fetch an SVN revision. Normally the
contents of an SVN revision should never change and reset
should not be necessary. However, if SVN permissions change,
or if you alter your --ignore-paths option, a fetch may fail
with "not found in commit" (file not previously visible) or
"checksum mismatch" (missed a modification). If the problem
file cannot be ignored forever (with --ignore-paths) the only
way to repair the repo is to use reset.
Only the rev_map and refs/remotes/git-svn are changed (see
$GIT_DIR/svn/*\*/.rev_map.* in the FILES section below for details).
Follow reset with a fetch and then git reset or git rebase to
move local branches onto the new tree.

Symfony2/Git/CloudControl switching from Composer to Submodules

I need to switch from Composer (which is used by Symfony2 by default) to Git submodules.
I thought I could just add the desired submodules to the desired locations, thus overwriting the current version which was installed by Composer.
But when I use git submodule add, it says:
'vendor/twig/twig' already exists in the index
So I tried:
git rm vendor/twig/twig
and tried to add the submodule again, same error.
What am I doing wrong?
I'm founder and ceo of cloudControl. Currently composer does break our image building process because it interferes with the logic we have to detect submodules in some way. The team is aware of this problem and working to fix the underlying issue.
I'm working for cloudControl and we've been lately inquiring into this issue.
Regarding the original problem, you proposed already a right solution for replacing the composer packages by git submodules, it was just a git commands issue. But doing this doesn't make much sense, as long as these git submodules are identical to the Composer packages and your php code is still hanging on the autoload.php provided by Composer.
We don't process internally Composer yet, their files are just added into the repository and the php code requirements make the rest. However we do process git submodules, so if you want to make a real switch from Composer to Git Submodules, the best option is getting rid of Composer files (vendor folder and composer.* files), adding git submodules wherever you want and handling again the php dependencies . Thus everything should work fine and you'd have switched completely to git submodules.
Native support for Composer is in our future plans.
The problem was that i had to actually delete and git-remove the repository first.
i.e. for twig what i did in the end was:
git rm -r vendor/twig/*
rm -r vendor/twig/*
git add vendor/.
git submodule add git://github.com/fabpot/Twig.git vendor/twig/twig
git submodule add https://github.com/fabpot/Twig-extensions.git vendor/twig/extensions
Now i have twig and twig extensions as a git submodule and can use it in my cloud application.

How can you use git-svn to clone parts of an SVN repo, but still get all the branches

Is there any way to use git-svn to clone only some folders of an SVN repo structure. I'm trying to clone a repo that has some crazy big binary files and a number of subfolders that are just plain useless. I've tried using the --ignore-paths option, but my clone seemed to just stall out doing nothing for an extremely long time. Have any of you managed to make --ignore-paths work? I can't find much on the webs where anyone else is running into this. Maybe I'm the only one.
We've used the "ignore-paths" feature to ignore certain directories in a svn repo:
[svn-remote "svn"]
ignore-paths = ^(((branches|tags)/[^/]+|trunk)|)(huge/|mobile/)
This config ignores the "huge" and "mobile" subdirs of the repository in trunk, all branches and all tags.
Perhaps you can illustrate the structure of your Subversion repository to make it easier for us to suggest some solutions.
Are you trying to git svn clone the entire repository from the root-url? Have you tried cloning smaller parts of the repo, and then perhaps grafting several clones together?
The most success I've had here is to manually create branches in git that mirror the SVN remote repository when necessary. The process has been the following:
Update .git/config file with:
[svn-remote "svn-branch-alias"]
url = http://svn/branches/crazybranchname/craziername/url/
fetch = :refs/remotes/git-branch-name
From the command line type: git svn fetch 'svn-branch-alias' to collect the SVN branch data into your local git repo.
Then type: git checkout 'git-branch-name' to go into a headless mode.
Finally type: git checkout 'my-local-git-branch-name' to create move head to the latest submission in that branch and create a local branch alias you can use.
You can now commit and dcommit as usual and still switch between various local git branches and your manually created SVN mirrors using the usual mechanisms.