How to properly update a git submodule?
I know this question has been beaten to death. But I still don't have a clear understanding of why my submodule is trying to refer to a commit in my superproject. I have a project which has a number of submodules, some of which reference github repositories which I want to contribute to. After updating the module, I pull the changes of the module:
[ashinn@puppet1 puppet]$ cd modules/ganglia
[ashinn@puppet1 ganglia]$ git branch
* (no branch)
[ashinn@puppet1 ganglia]$ git pull origin master
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 4), reused 4 (delta 2)
Unpacking objects: 100% (6/6), done.
* branch master -> FETCH_HEAD
Merge made by recursive.
README | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
Now I want to update the reference to the module in the superproject:
[ashinn@puppet1 ganglia]$ cd ../..
[ashinn@puppet1 puppet]$ git add modules/ganglia
[ashinn@puppet1 puppet]$ git commit -m 'updated ganglia module'
[ganglia c172591] updated ganglia module
1 files changed, 1 insertions(+), 1 deletions(-)
I am currently working on the ganglia branch, so I push it to my origin (which is 2 differen't URLs):
[ashinn@puppet1 puppet]$ git push origin ganglia
Counting objects: 8, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 616 bytes, done.
Total 6 (delta 4), reused 0 (delta 0)
1876698..c172591 ganglia -> ganglia
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 323 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: From /var/lib/puppet/repo
remote: dcd1fcc..c172591 ganglia -> origin/ganglia
remote: From https://github.com/andyshinn/puppet-ganglia
remote: a0c4e21..975c92f master -> origin/master
remote: fatal: reference is not a tree: c5defdeae006c7b87058cc5c79aef60087b63a6b
remote: Unable to checkout 'c5defdeae006c7b87058cc5c79aef60087b63a6b' in submodule path 'modules/ganglia'
remote: Updating existing environment ganglia
dcd1fcc..c172591 ganglia -> ganglia
The remote has a post-receive script to checkout branches in different folders and run
git submodule update --init for each. If I manually connect to the origin repo I can verify the issue:
-bash-4.1$ git pull
-bash-4.1$ git submodule update --init
fatal: reference is not a tree: c5defdeae006c7b87058cc5c79aef60087b63a6b
Unable to checkout 'c5defdeae006c7b87058cc5c79aef60087b63a6b' in submodule path 'modules/ganglia'
What am I doing wrong here?
I am sitting on a proxy which only allows http/https traffic only, I am able to clone a repository from Github, but I have to fetch/push using the https URL and username/password. Now my issues is a
I have a new team member who gets a Permission Error when trying to perform their initial git submodule update: [mrTeamMember@desktop application]$ git submodule update Initialized empty Git repositor
I was following the guide from here John Anderson Vim Setup to help setup vim. he steps through adding the various submodules to git in the format git submodule add http://github.com/tpope/vim-fugitiv
[update at bottom] This has now happened twice in last fifteen minutes. When I issue the following command from parentmodule git submodule foreach git pull --rebase It prints messages about updating
I set up my git account on Machine A, did a git commit, then git push origin master. On Machine B, I did a git clone XXX ...and it cloned it from my origin. Now, after I make changes and push it t
I'm trying to add an external repo as a submodule of my repo, so I followed these instructions, doing: git submodule add git:... vendor git submodule init git submodule update then I tired: git submo
Is this something I am doing wrong, or a wider bug? If I execute the following git commands in an empty directory: git init git submodule add https://github.com/doctrine/DoctrineMongoODMModule \vendor
I am currently trying to clone some of my vim settings from my git repo, and the repo mostly contains submodules of other hosted projects. However, when I try to update all of my submodules, I get the
I have a git project (repo1) including a single submodule (repo2). What I would like to achieve is to tag my project using an older commit of my submodule (like HEAD - 3). I tried with a checkout of t
I have a Git repository that includes a submodule. This repository has various build configurations in TeamCity that are dependent on code on the submodule. Is there a way with TeamCity to detect tha
I wish to update the usernames for a user in the Git history, is this possible? It was a blunder of mine, I migrated from CVS a while ago and didn't realise until everyone started using the Git repo t
I have just started using Git for my Xcode projects. I am working on one project, and I have imported another Git repository as a submodule. The files of the submodule are imported into my working cop
I'm trying to properly create and apply patches using Git : I created a new git project, with two files : first.txt and second.txt I create a branch In this new branch, I modify the content of both f
After some time I wanted to update my git repo, and then something went wrong. What is the proper way out of this situation? mblsha@siruba:~/src/psi/ $ git status iris: needs merge # On branch master
I'm using git 1.8.4 and trying to add a submodule that tracks master of another repository. I tried adding it as follows: git submodule add -b master /path/to/myrepo.git And I get the following error
When using svn, I update a repository with the following command. TortoiseProc.exe /command:update /path:c:\FoldToSVNRepository TortoiseProc.exe /command:update /path:c:\FoldToSVNRepositoryTwo Tor
I created a git submodule and pushed it onto our main repository. This worked fine and I can see the submodule in the repository via a browser. To test it works fine, I tried to get the source is a f
Is it possible to execute a read inside a git foreach? git submodule foreach 'read -p test; echo $REPLY' does not work at all as the read gets the input from git itself - which is the objname and h
I have a git repo with a dev and a master branch. Now I am trying to use a different revision of a submodule in each branch. So for example I do this: git checkout master cd submodule git checkout v1.
I am not able to clone the submodule existing within my private git repository. I do have access to entire repository, Have used the below commands but dint work, please help what is the right way to
I have a git submodule (RestKit) which I have added to my repo. I accidentally changed some files in there and I'd like to go back to the source version. In order to do that, I tried to run Mac:app-i
I have a repository with various nested submodules. Committing and pushing works pretty well and the changes are visible at GitHub as expected. In the testing/production environments, new releases are
I have been using git commands for my project. If I made one wrong commit and pushed into my branch. On that time, how can I update it back ? If I need to copy last three commits to new branch, how
Is there a way, short of actually checking out the parent commit, to determine a submodule's SHA-1 commit ID based on a commit ID in the parent clone? I know I can find the currently associated SHA-1
I'd like to create a new repository as a submodule of my project. Usually, I create a Github repo and then add it as a submodule using the command git submodule add url_to_repo.git Is there a way to c
I love git submodules. Also, I hate git submodules. What I love about them is how it enables to you to cleanly compartmentalize dependencies etc. I get the point of having them point to a specific com
I am using a new red hat os, with git version 1.7.6 (also tried 1.9.2). I also have a debian 6 machine with git 1.7.6. When I create a clone and populate a submodule on the debian machine, the submodu
I have been an iphone developer for a while, and I have recently been including git in my workflow. I have used git settings found on http://shanesbrain.net/2008/7/9/using-xcode-with-git for my workfl
We are using submodules and we are new to git. We often see merge conflicts for the submodules themselves, no files are conflicted, just the submodule. There are multiple versions listed in the output
I'm using a few repository which I do not host myself and I thinking what if I deploy my application while they are not available? This simply just can't happen. Is there a way to freeze the submodu
I have two git identities, one is a personal one and the other is for my employer. My work project uses a submodule and although I can clone the main repo fine, I am not able to update the submodule.
I have a pretty straightforward setup on github, with a submodule repository (also on github). I'm having some problems with permissions on the submodule while the parent repository works fine. On my
I want to figure out why git submodule foreach command is not working for me. I have cloned a git repository which has several submodules. I wanted to init and update all submodules at once to pull do
I'd like to use git submodule. The steps I need to take to push my changes to my project are add/commit/push from submodule directory add/commit/push from parent directory Steps I need to take to
I'd like to get a git log for the repository and all submodules. The manpage says that git log --submodule should be used but this doesn't work for me. ------- Edit ------- As an example - what I run:
user$ sudo git submodule update fatal: reference is not a tree: a094dcfeeb43fcd62a9e466156e05e7581026f33 Unable to checkout 'a094dcfeeb43fcd62a9e466156e05e7581026f33' in submodule path 'client/src/uti
I have a submodule in this folder abc/submodule , I remove it with these commands: rm -rf abc/submodule # remove submodule in .gitmodules # remove submodule in .git/config git rm --cached abc/submodul
I am new to git and I want to start doing things 'properly'. I quite like this flow: git checkout -b featurebranch git commit -m some changes // manytimes * git pull // update master to origin's hea
I've named by error a branch -update. When I try to rename it with git branch -m -update update I get the error error: unknown switch 'u'. Is there a way to rename the branch? Thanks!
I'm very new to using git, and previously haven't really tried to organize any projects I've worked on. I just recently purchased a development server for personal use, however, and I wanted to star
I need to clone a repository from Github and am using Git Shell provided with the Github for Windows package. The repository contains submodules and I don't know why, (first time) I cannot use submodu
Is there a built-in way (or a simple script) that won't let me check in if any of the submodules have modified files? As it stands now, I have useless commits, since I cannot return to the submodule's
How do I un-submodule a git submodule (bring all the code back into the core) ? As in how should I, as in Best procedure ...
I am working on a project where there are a number of submodules. Yesterday, everything was peachy, app was running, etc. After I ran git submodules update this morning, I receive an error in the appl
I have this following scenario that keeps coming back: I commit a change in some files, along with an update to a submodule. Someone else commits and pushes an update to the same submodule. git pull
So I've been using git submodules, and when I get more than 3 layers deep I start getting bad objects. Directories aren't exceeding 200 characters. I get the following errors: user@USER-LT /C/Dev/Act
Let's say you have a parent project and submodule. There is a user who has read/write permission to the parent project but only read permission for the submodule. How do you stop the user from making
I've cloned a git submodule of one of my libraries into a project I'm working on. The thing is that, after cloning, I need to change some lines in the cloned submodule, but I don't want to push those
I have added a submodule and checked in this submodule fully, I have then checked in my master project. Now my team mate who had checked out the master project before i added a submodule only gets an
I'm logged in as user A on my machine, but my repo is accessible through username B on the server that I pull from. The .gitmodules file has url = ssh://domain.com/abc/def.git. How can I configure git