Removing a Git Submodule

By Albert on September 24, 2011 9:50 AM

I’m noting these instructions on how to remove a git submodule for future reference:

  1. Delete the relevant line from the .gitmodules file.
  2. Delete the relevant section from .git/config.
  3. Run git rm —cached submodule_path.
  4. Commit and delete the now untracked submodule files.
  5. Run rm -rf submodule_path.

In general, I’m not very fond of git submodules. They are very clunky and can get messed up so easily. Compared to subversion externals, they are not very useful in my humble opinion.

Subversion externals acts just how I would expect - its a reference to another subversion repository within a subversion repository. Git submodules are pegged to a particulate commit of the other repository, and I’ve run into several problems with submodules becoming corrupt.

Git Subversion - SVN authentication?

By Albert on July 14, 2011 7:21 PM

I am trying out git svn and its working OK, but I’ve hit a snag (not a show stopper): I can’t get my svn credentials to use GNOME’s session manager.

Otherwise, I am also a little annoyed that I can’t dcommit to the subversion repository if there are unstaged changes to the current tree. As a stopgap measure, I am simply stashing my changes until I make the dcommit.

Git Remote Branch Commands

By Albert on March 4, 2011 5:37 PM

I’ve been wanting to figure out how to set an existing local branch to track a remote branch for awhile. Here’s how! As well as the command to delete a remote branch.

To set the a branch to track a remote branch:

git branch --set-upstream mybranch remotes/origin/mybranch

To delete a remote branch:

git push origin --delete mybranch

Categories