I would like to clone a SVN repository with git-svn, and without downloading some -- unuseful for me -- 'huge' files (recognized by the extension because they are not all in the same folder).
git-update-index --assume-unchanged or git-gc allow to compress the local repository, but the files are downloaded.
Is it possible to use something like sparse-checkout with git-svn ?
or what is a solution to avoid to download some files with git-svn ?
--ignore-paths option of git-svn may help you.
Related
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
If I tell git to ignore x amount of files and never add them to the repository, will those files also make it into the svn:ignore property? And if so, how can I keep .gitignore local to only my local git repository?
EDIT Sorry about the duplicate, I searched on here and couldn't find anything on it.
No, git will not do anything with svn:ignore.
From the documentation:
We ignore all SVN properties except svn:executable. Any unhandled properties are logged to $GIT_DIR/svn//unhandled.log
Also this other StackOverflow question is very similar.
If you want the .gitignore local to your repo, don't commit it.
Similar question:
How can you indicate files to ignore in svn when using git and the git-svn bridge
git-svn does neither .gitignore — svn:ignore, nor git attributes — svn properties conversion.
You may consider using SubGit instead. It does properly handle ignore, properties, merge-tracking data, etc. Among other things it works on a server-side, so one can use any Git client available to send changes to Subversion repository.
See documentation and comparison with git-svn.
I've started using git-svn for an SVN-based project, so that I can make local commits.
However, the SVN repository contains a lot of directories that I don't need to work with. When I solely used SVN, I was able to partly check-out stuff with:
svn co <repos-url> --depth empty
and then update the needed directories:
svn up <repos-dir>/<subdir>
As far as I've understood, partly checking out a project isn't an option with Git, so I'm looking for alternative way of saving some space. Any suggestions?
Edit: what I am thinking myself is something in the lines of creating a branch thatonly contains the files I need. I'd then want to be able to push the changes to these files without pushing any removal of the files I don't need. But I am not too deply into the way Git works to figure out if this is possible?
Are the extra directories really that big? One advantage of Git is that you do most of your work from your local harddrive (you commit to your own branch, not to the server) so it's fast even when there are many files.
Is it possible to check-out a Bzr repo via Svn externals using an Svn client?
If Bzr is being served over Web-DAV (it is in my case) it seems like it should be possible, unless Svn needs all the ".svn" folders.
You can use the bzr-svn plugin to push the bzr branch into you svn repository, then you can use that as an external.
No. Cause Bzr is working different than subversion and the SVN client does not know how to handle a bzr repository.
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.