3 # this script works on a specialized type of git checkout that has been configured
4 # to push to a "downstream" repository, while still pulling from its normal origin.
5 # the downstream destination might be a github or sourceforge repository that is
6 # loaded from a personal repository or server.
8 # it is assumed that you have already added your ssh key to your github account.
10 # to set up the repository for relaying downstream, just do the normal checkout
11 # or clone on it from the real origin. for example:
13 # $ git clone git://feistymeow.org/feisty_meow feisty_relay
15 # change into that new directory:
17 # $ pushd feisty_relay
19 # and then add the downstream remote repository:
21 # # github example of add:
22 # $ git remote add downstream git@github.com:fredhamster/feisty_meow.git
24 # # sourceforge example of add:
25 # $ git remote add downstream ssh://fred_t_hamster@git.code.sf.net/p/feistymeow/trunk
27 # once the repository has been created, you can synch all updates that
28 # have been checked into the origin repository with the downstream version
29 # by running this command:
31 # push_repo_downstream ~/relay_repo_folder
33 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
34 source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
38 # turn off occasionally troublesome setting before checkin.
44 if [ -z "$dir" ]; then
48 pushd "$dir" &>/dev/null
49 exit_on_error "changing to directory: $dir"
50 tempfile=$(generate_rev_ctrl_filelist)
51 exit_on_error "generating revision control file list"
53 perform_revctrl_action_on_file "$tempfile" do_revctrl_careful_update
54 exit_on_error "doing a careful update on: $tempfile"
58 # seems to be needed to cause a merge to be resolved.
59 git pull downstream master
60 # -m "unfortunate merge"
61 exit_on_error "running the git pull downstream master"
63 # send our little boat down the stream to the dependent repository.
64 git push --tags downstream master
65 exit_on_error "running the git push downstream master"
67 # do our dev branch also.
68 git push --tags downstream dev
69 continue_on_error "running the git push downstream dev: is there a dev branch?"
73 restore_terminal_title