Skip to content

Instantly share code, notes, and snippets.

@hlee
Forked from necolas/gist:2215692
Created September 3, 2013 13:41

Revisions

  1. @necolas necolas revised this gist Mar 27, 2012. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -29,4 +29,5 @@ git push origin master

    # When updating a local repository from the remote repository I use
    # `git submodule update` to update the submodules (that have been
    # initialized) in their local repository. This wipes any local changes.
    # initialized) in their local repository. This wipes any local
    # changes made to the submodule.
  2. @necolas necolas revised this gist Mar 27, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # Workflow from https://github.com/necolas/dotfiles

    # Add the new submodule
    git submodule add git://example.com/remote/path/to/repo.git vim/bundle/one-submodule
    # Initialize the submodule
  3. @necolas necolas revised this gist Mar 27, 2012. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -23,4 +23,8 @@ git add vim/bundle/one-submodule
    # Commit the submodule changes
    git commit -m "Update submodule 'one-submodule' to the latest version"
    # Push to a remote repository
    git push origin master
    git push origin master

    # When updating a local repository from the remote repository I use
    # `git submodule update` to update the submodules (that have been
    # initialized) in their local repository. This wipes any local changes.
  4. @necolas necolas renamed this gist Mar 27, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. @necolas necolas created this gist Mar 27, 2012.
    26 changes: 26 additions & 0 deletions cmds.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    # Add the new submodule
    git submodule add git://example.com/remote/path/to/repo.git vim/bundle/one-submodule
    # Initialize the submodule
    git submodule init
    # Clone the submodule
    git submodule update
    # Stage the changes
    git add vim/bundle/one-submodule
    # Commit the changes
    git commit -m "Add a new submodule: one-submodule"

    # Update an individual submodule within the superproject
    # Change to the submodule directory
    cd vim/bundle/one-submodule
    # Checkout the desired branch (of the submodule)
    git checkout master
    # Pull from the tip of master (of the submodule - could be any sha or pointer)
    git pull origin master
    # Go back to main dotfiles repo root
    cd ../../..
    # Stage the submodule changes
    git add vim/bundle/one-submodule
    # Commit the submodule changes
    git commit -m "Update submodule 'one-submodule' to the latest version"
    # Push to a remote repository
    git push origin master