Git Submodule fatal reference is not a tree - git-submodules

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.

Related

updating named git submodules fails with fatal error

I have worked with git submodules in the past. I know the basic functionality.
If I simply used git submodule add <repo-url> <path/to/submodule>, the .gitmodules file would have :
[submodule "path/to/submodule"]
path = path/to/submodule
url = <repo-url>.git
Recently, I had to add a new git submodule to a repository that I was working on. I also found the fancy --name flag that can be used with the git submodule add command, from the man page of git submodule. The add worked fine and my .gitmodules had :
[submodule "<submodule-name>"]
path = path/to/submodule
url = <repo-url>.git
The issue happens when I'm attempting to update the submodule from the remote :
$ git submodule update --remote
fatal: no submodule mapping found in .gitmodules for path 'path/to/submodule'
OK, I can read the log, so I provide the path/to/submodule next :
$ git submodule update --remote path/to/submodule
Submodule path 'path/to/submodule' not initialized
Maybe you want to use 'update --init'?
OK, if you say so ( though I'm sure that the submodule has been properly initialized before already ). Now :
$ git submodule update --init --remote path/to/submodule
fatal: No url found for submodule path 'path/to/submodule' in .gitmodules
I did some experiments on a test repository and found that this happens only when the submodule is 'named'.
Am I doing something wrong with the name thing of the submodule? According to the man page, the --name flag is only applicable for the add sub-command and it does not work with update.
How do I update such named submodules?

Error when cloning a svn repository using 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.

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.

submodule project not present in `git submodule status` roster and unable to commit from parent as single object

I use git submodule add <GitHubURL.git> to add projects as submodules to a main "parent" project repository.
Parent_Project_repo
- SubA_repo
- SubB_repo
- SubC_repo
- Sub_Problem_Child_repo
As I work in the submodules, I make commits within the Sub*_repo project (per usual, committing whichever files I have worked on). In the parent project, however, usually I am just making a single commit for all the submodules commits. This single commit of the submodule usually shows up like so in the Parent_Project_repo:
I have recently added a submodule which, from the parent repository, displays each individual file in the commit history instead of just accessing all the files/commits in one single "Subproject" commit object.
Of note:
this problematic submodule does not show up in the roster when I
invoke:
git submodule status
It is listed in the
Parent_Project_repo/.gitmodules
Parent_Project_repo/.git/config
file as a submodule & there is a corresponding
Parent_Project_repo/.git/modules/Sub_Problem_Child_repo/ folder.
How can I get the problem child into the roster and able to have all it's commits handled by the Parent_Project_repo as one object?
UPDATE:
The only difference I have discerned with the “problem child” submodule is that it doesn’t have a “historySha” key in the /.git/modules/config file, e.g.:
[atomGithub]
historySha = 1936e4c373c130860a8f92683b517dad713ec37
Also, these commands don't get the Problem child listed in the status:
$ git submodule update --init --recursive
$ git submodule update --recursive
$ git submodule init
...nor showing up on GitHub in the Parent project with a "# e78c392" which indicates I can double click the link and got to that repo instead of a copy inside the superproject (Parent).
If git submodule add <URL> was used to set up a git repository as a submodule within a "super-project" and the submodule is NOT committing within the super-project as a single object (i.e. if, when committing the submodule from within the Super project you are having to commit each individual file from the submodule), then follow these steps to reconfigure:
Save all work in the submodule.
Stage and commit all file changes.
Push all commits to GitHub.
Make a safety copy of the submodule folder if you are cautious
Delete the relevant submodule section from the super-projects .gitmodules file (i.e. remove the listing of the problem submodule).
Stage the .gitmodules changes git add .gitmodules
Delete the relevant sunmodule section from super-projects .git/config.
Run git rm --cached -rf PATH_TO_SUBMODULE where PATH_TO_SUBMODULE is the actual path to the submodule folder.
Run rm -rf .git/modules/PATH_TO_SUBMODULE.
Commit git commit -m "Removed submodule commit message".
Delete the now untracked submodule files: rm -rf PATH_TO_SUBMODULE
git submodule add <URL>
Test to see if a change (fwiw, modify two files) in the submodule is handled as a single object when committing in the super-project.
Success? Delete the safety copy of the submodule project.

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