Sha256: d1be96623be15868fa71792d116f02cc0e03ebcd40cad07da764159789bd3e6d

Contents?: true

Size: 1.18 KB

Versions: 268

Compression:

Stored size: 1.18 KB

Contents

#!/bin/bash

set -ex

# Make a directory to work in:
{
  ROOT=${BASH_SOURCE%.sh}
  [ -n "$ROOT" ] || exit 1
  rm -fr "$ROOT"
  mkdir "$ROOT"
}

(
  cd "$ROOT"

  # Create "bare" repos to act as pushable upstreams
  git init --bare parent-upstream
  git init --bare child-upstream

  # Clone the upstreams into local repos
  git clone parent-upstream parent
  git clone child-upstream child

  (
    cd parent
    echo 'Initial parent commit' > parent.txt
    git add parent.txt
    git commit -m 'initial parent commit'
    git push
  )

  (
    cd child
    echo 'Initial child commit' > child.txt
    git add child.txt
    git commit -m 'Initial child commit'
    git push
  )

  (
    cd parent
    git subrepo clone ../child-upstream childrepo
  )

  (
    cd child
    echo 'Commit from child' >> child.txt
    git commit -a -m 'commit from child'
    git push
  )

  (
    cd parent
    git subrepo pull childrepo
  )

  (
    cd parent
    echo 'Commit from parent for pushing' >> childrepo/child.txt
    echo 'Commit from parent for pushing' >> parent.txt
    git commit -a -m 'Commit from parent for pushing'
    git push
  )

  (
    cd parent
    git subrepo push childrepo -d || bash -i
  )
)

Version data entries

268 entries across 268 versions & 4 rubygems

Version Path
eac_tools-0.86.5 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.86.4 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.86.3 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_git-0.16.0 vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.86.2 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_git-0.15.0 vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.84.2 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.84.1 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.84.0 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.83.0 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.82.0 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.81.0 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.80.0 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.79.0 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.78.0 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.77.1 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.77.0 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.76.1 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.76.0 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh
eac_tools-0.75.2 sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh