Kaydet (Commit) acbde813 authored tarafından Christian Lohmaier's avatar Christian Lohmaier

when creating linked clone with branch, make sure to ff to the current state

the git-new-workdir helper is mostly useful to have one pristine clone
where the updates get pulled into & from that you create working copies.
As pulling to that master copy only updates the current branch (usually
master), checking out a different branch using git-new-workdir will
result in "your branch is behind the remote branch by xx commits" when
there have been commits after the branch was first checked out locally.

Thus this change adds a fast-forwarding merge when a branch is given.
üst 2c05867b
......@@ -80,3 +80,7 @@ cp "$git_dir/HEAD" .git/HEAD
# checkout the branch (either the same as HEAD from the original repository, or
# the one that was asked for)
git checkout -f $branch
if test -n "$branch"
then
git merge --ff-only '@{upstream}'
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment