Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions git-export/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Example Directory #

```
my-book/
|__ book
|__ common
|__ images
|__ master.adoc
|__ upstream/
```

# Example Usage #

1. Refresh your fork
1. cd <DIRECTORY>/
2. git checkout master
3. git pull --rebase <REMOTE> master
4. git push origin HEAD
2. Checkout a new branch
1. git checkout -b <BRANCH NAME>
3. Refresh the upstream folder
1. rm -rf upstream/$* upstream/$*.revisiong
2. scripts/git-export "<GITHUB REPOSITORY>" <BRANCH> upstream/$*
3. git add --all upstream
4. Commit new upstream to downstream repo
1. git commit -a -m "<COMMIT MESSAGE>"
2. git push origin HEAD
5. If new assemblies have been added remember to update <DIRECTORY>/master.adoc
6. If new attributes have been added remember to update <DIRECTORY>/common/attributes.adoc
7. Merge synced content
1. Go to your fork https://<GITLAB URL>/<username>/amq-streams
2. Click __Merge Requests__ on the left
3. Create merge request
4. Finalize the merge in the Downstream repo
22 changes: 22 additions & 0 deletions git-export/git-export
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -eu

URL=$1
BRANCH=$2
DIR=$3

mkdir -p $DIR

DIR=$(readlink -f $DIR)
TMP=$(mktemp -d)

(
cd $TMP

git clone --bare --branch "$BRANCH" "$URL" .
git archive "$BRANCH" | tar -xf - -C "$DIR"
git rev-parse HEAD > "${DIR}.revision"
)

rm -rf $TMP