Either will work, but the result is different.
git merge working
will create a single, new merge commit which combines the history of both branches. The commits are shared by both branches.
git rebase test working^{commit} && git push . HEAD:test && git checkout test
will rebase, i.e. copy, the commits on working
to test
. The commits are now duplicated and separate versions of the commits exist in both branches.
The third option is to cherry-pick, which is similar to rebase, but switches source and destination.
git cherry-pick test..working
will cherry-pick, i.e. copy, the commits on working
and apply them to your test branch. The commits are duplicated and separate in both branches.
History after merge:
D-E -- working
/ \
A-B-C \ -- development
\ \
F-G-----M -- test (M = merge commit)
History after rebase or cherry-pick:
D-E -- working
/
A-B-C -- development
\
F-G-C'-D'-E' -- test (C', D', E' = copied commits)