[Q] push refspec with wildcard pushes all matching branches
- From
Bert Wesarg <bert.wesarg@googlemail.com>
- Date
- Jan 24, 2020, 20:29 UTC
- Message-ID
- <ed9a0485-1e6c-79ae-6a59-655105203728@googlemail.com>
Dear all,
I'm a little confused, that a push refspec with a wildcard changes the number of branches pushed.
Here is what I see with Git 2.25:
$ git --version
git version 2.25.0
$ git config --list
user.email=bert.wesarg@googlemail.com
user.name=Bert Wesarg
$ git init --bare bare.git
$ git clone bare.git repo
Cloning into 'repo'...
warning: You appear to have cloned an empty repository.
done.
$ cd repo
$ git config push.default current
$ echo foo >foo
$ git add foo
$ git commit -m foo
[master (root-commit) 4d0b276] foo
1 file changed, 1 insertion(+)
create mode 100644 foo
$ git branch master-two
$ git push --dry-run
To ../bare.git
* [new branch] master -> master
$ git config remote.origin.push 'refs/heads/master*:refs/remotes/origin/master*'
$ git push --dry-run
To ../bare.git
* [new branch] master -> origin/master
* [new branch] master-two -> origin/master-twoIs this expected behavior?
Thanks.
Best, Bert