Error when cloning a svn repository using git-svn - git-svn

I am trying to migrate a SVN repo to a git. For this I am using git-svn tool. I'm running the command:
git svn clone [SVN repo URL] --no-metadata -A authors-transform.txt --stdlayout ~/temp
and I'm getting the following error:
Name does not refer to a filesystem directory: Can’t get entries of non-directory at /Applications/Xcode.app/Contents/Developer/usr/share/git-core/perl/Git/SVN/Ra.pm line 312.”
Line 312 of that script is:
$reporter->finish_report($pool);
So I understand that finish_report is failing, but I don't understand why.

That particular section in perl/Git/SVN/Ra.pm is seven years old and part of the initial split of git-svn.perl
Try instead subgit (in its free version, for a one-shot import): it should be more robust.

Related

Git Submodule fatal reference is not a tree

Hi I am getting fatal: reference is not a tree: 947a3c67349eb242a8d46d576e544f8129b28cbf
Unable to checkout '947a3c67349eb242a8d46d576e544f8129b28cbf' in submodule path 'modules/webform'
My work station is as follows:
[root]:
.gitmodules
/modules/webform
Inside .gitmodules I have:
[submodule "modules/webform"]
path = modules/webform
url = https://git.drupal.org/project/webform.git
I have gone into modules/webform and git pull I have also git submodule sync, which gives me Synchronizing submodule url for 'modules/webform'. I have even hard reset that directory. I was wondering if there is a way to delete that reference/reset to the newest version? when I git log it gives me that the reference is a bad object.
I had to update my git --version. I was on 1.7, the latest is 2.1 or something.

Make.git open in ssh

I have download a git with a wget on a vps through putty.
I see the file is listed on the vps like so:
bitcoin-sniffer.git .lastlogin .python_history
Now how can I execute the .git, or actually use the files that are within it? I have tried
git clone bitcoin-sniffer.git
The error:
fatal: destination path 'bitcoin-sniffer.git' already exists and is not an empty directory.
Generally, the git clone command is followed by an address with ssh or HTTPS path to download a repo. The git command is not run against a *.git "package".
An example would be:
bash
git clone https://github.com/sebicas/bitcoin-sniffer.git
This would download and create a folder by the name bitcoin-sniffer. Within this folder, git commands can be run, like git status.
The "git" you acquired is a full git repository, with the entire history of the protect and all the information you need to get the current state of the files. Judging by the .git extension, I would assume that the repository is "bare", meaning that it only contains the compressed history but not a working copy of the current state of the project. Conventionally, bare repos have a .git extension, while a full working copy would have a .git folder in the project root.
Your intuition to clone the repository to get a working copy is correct. It's not working because by default, git clone running locally will try to make a folder with the same name as the repo. Give it a different folder name as an additional parameter instead:
git clone bitcoin-sniffer.git bitcoin-sniffer
This is actually doing an extra step in all probability. You can clone directly from a remote location using either SSH or HTTPS. If your project comes from GitHub, for example, you can get a read-only copy (that you can modify locally but not push back) anonymously over HTTPS:
git clone https://github.com/sebicas/bitcoin-sniffer.git
You really shouldn't be getting "gits" using WGET under normal circumstances.

How do I clone a git repo from a local svn repo

I want to learn to use git-svn. I have an svn local repository on my disk that I've checked out a while ago using something like this:
svn co http://myserver.com/mysvnrepo/trunk/ /mysvnrepo/
ls -a /mysvnrepo/
. .. .svn foo bar
This /mysvnrepo/ is HUGE, so I want to avoid re-downloading or copying the files at all costs.
I'm wondering if there's a way to git clone this local repo without downloading / copying anything (because it's already there).
I have this which seems to be what I'm looking for, but when I do that it doesn't quite give me what I expect.
cd /mysvnrepo/
git svn clone file://mysvnrepo/
ls /mysvnrepo/
. .. .git .svn foo bar
git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .svn/
# foo/
# bar/
I would expect git to detect foo and bar as "versioned and up-to-date".
According to the docs it seems that I need to use git svn init because git svn clone runs a fetch, which I certainly don't want. So I tried
git svn init --trunk=file:///mysvnrepo/
...but no luck.
I'm completely new to git, so my confusion is off-the-charts... am I doing something utterly wrong?
Thanks in advance
You cannot take a subversion snapshot and convert it into a git repository.
It sounds like you are trying to avoid a lengthy initialization of the git repository from svn: which ordinarily will try to ready your entire history. This can be done in another way, by limiting the fetch to recent history depending on how much history is relevant to you:
git svn clone -s -r 12334:HEAD https://svn.host.org/repo
Where 12334 is the earliest svn revision you are interested in and assuming that the repo is laid out in a standard svn way with branches and tags.

How To Upload Files on GitHub

I have recently downloaded GitHub and created a repository on it. I am trying to upload an Objective C project in it. How do I go about doing this?
I didn't find the above answers sufficiently explicit, and it took me some time to figure it out for myself. The most useful page I found was:
http://www.lockergnome.com/web/2011/12/13/how-to-use-github-to-contribute-to-open-source-projects/
I'm on a Unix box, using the command line. I expect this will all work on a Mac command line. (Mac or Window GUI looks to be available at desktop.github.com but I haven't tested this, and don't know how transferable this will be to the GUI.)
Step 1: Create a Github account
Step 2: Create a new repository, typically with a README and LICENCE file created in the process.
Step 3: Install "git" software.
(Links in answers above and online help at github should suffice to do these steps, so I don't provide detailed instructions.)
Step 4: Tell git who you are:
git config --global user.name "<NAME>"
git config --global user.email "<email>"
I think the e-mail must be one of the addresses you have associated with the github account. I used the same name as I used in github, but I think (not sure) that this is not required. Optionally you can add caching of credentials, so you don't need to type in your github account name and password so often. https://help.github.com/articles/caching-your-github-password-in-git/
Create and navigate to some top level working directory:
mkdir <working>
cd <working>
Import the nearly empty repository from github:
git clone https://github.com/<user>/<repository>
This might ask for credentials (if github repository is not 'public'.)
Move to directory, and see what we've done:
cd <repository>
ls -a
git remote -v
(The 'ls' and 'git remote' commands are optional, they just show you stuff)
Copy the 10000 files and millions of lines of code that you want to put in the repository:
cp -R <path>/src .
git status -s
(assuming everything you want is under a directory named "src".) (The second command again is optional and just shows you stuff)
Add all the files you just copied to git, and optionally admire the the results:
git add src
git status -s
Commit all the changes:
git commit -m "<commit comment>"
Push the changes
git push origin master
"Origin" is an alias for your github repository which was automatically set up by the "git clone" command. "master" is the branch you are pushing to. Go look at github in your browser and you should see all the files have been added.
Optionally remove the directory you did all this in, to reclaim disk space:
cd ..
rm -r <working>
Well, there really is a lot to this. I'm assuming you have an account on http://github.com/. If not, go get one.
After that, you really can just follow their guide, its very simple and easy and the explanation is much more clear than mine: http://help.github.com/ >> http://help.github.com/mac-set-up-git/
To answer your specific question: You upload files to github through the git push command after you have added your files you needed through git add 'files' and commmited them git commit -m "my commit messsage"
You need to create a git repo locally, add your project files to that repo, commit them to the local repo, and then sync that repo to your repo on github. You can find good instructions on how to do the latter bit on github, and the former should be easy to do with the software you've downloaded.
To upload files to your repo without using the command-line, simply type this after your repository name in the browser:
https://github.com/yourname/yourrepositoryname/upload/master
and then drag and drop your files.(provided you are on github and the repository has been created beforehand)
Here are the steps (in-short), since I don't know what exactly you have done:
1. Download and install Git on your system: http://git-scm.com/downloads
2. Using the Git Bash (a command prompt for Git) or your system's native command prompt, set up a local git repository.
3. Use the same console to checkout, commit, push, etc. the files on the Git.
Hope this helps to those who come searching here.
if you're on windows:
http://windows.github.com/
otherwise:
http://git-scm.com/downloads/guis
If you want to upload a folder or a file to Github
1- Create a repository on the Github
2- make: git remote add origin "Your Link" as it is described on the Github
3- Then use git push -u origin master.
4- You have to enter your username and Password.
5- After the authentication, the transfer will start

Incomplete Clone Using Git-Svn

I have an Svn repository at http://svn.domain.com/project that is structured as follows:
trunk/
build_file_1.xml
build_file_2.xml
project_root/
branches/
cc2.10/
cc3.00/
..
cc3.5/
jira-labs-39/
tags/
studio-2.10.0.0/
studio-2.10.0.1/
...
studio-3.4.1.0/
I want to clone the trunk and branches, but I'm only getting the trunk and the first branch. I'm using this command to clone:
git svn clone http://svn.domain.com/project working-dir --trunk=trunk --branches=branches --prefix=svn/
What I end up with is this:
$ git br -r
svn/cc2.10
svn/trunk
I need to do some work on one of the other branches, but can't figure out what I'm doing wrong. Can someone point me in the right direction?
UPDATE
I just noticed the following error at the end of the output stream:
merge-base 7c552afeaba8194137acb95e642a2222db801dad c40b790b610dc43da93de5328832b1f852a14ef2: command returned error: 1
I assume that error is aborting the clone before it's complete, but I can't find any reference to the error or what it means in order to debug.
So the problem appears to be in the fact that Git-Svn tries to being cloning from one directory above the requested start point. Using the --no-minimize option fixed that.
git svn clone http://svn.domain.com/project working-dir -s --no-minimize-url