Closed mhogerheijde closed 4 years ago
Oh and if it matters:
$ bit --version
bit version v0.5.10
git version 2.25.1
@mhogerheijde do you have a recommendation on how to determine the default remote
name. For example, I could run git remote -v
and then simply pick the first line which would get a upstream but not necessarily the right one in your case when there are multiple remotes
bit remote
origin
Hmm, I'd say that if there is an ambiguity that bit
should ask the user. I think git
also does this with multiple remotes.
In my case specifically, I have 1 remote called upstream
. So I'd say pick one automatically if it is not ambiguous, and ask the user otherwise?
Not that the ambiguity could also be solved by the .git/config
file where it states the remote
for the current branch. This already works as expected with bit
.
Ah, right, I just double checked: if no section exists for the current branch like this:
[branch="master"]
remote = origin
merge = refs/heads/master
git
will complain about not having any information on where to push to/pull from.
I usually don't notice, because I generally try to be explicit and would type git pull upstream master
and thus git
has all the context it needs.
bit sync
, however, doesn't allow to specify the remote. That is, it does according to the help text, but it doesn't do anything.
@mhogerheijde Cool, that helps. In version 0.9.0 milestone you'll be able to specify remote and branch via bit sync <upstream> <branch>
!
This is fixed with 2e0a6056c70f026587a09eea3f21317b70f2ee2b & c66f14628ecbf064e3426d1d2121829f50a07c52 as of v0.9.1
. Please reopen if you have any problems
Seems to work :+1: thanks!
I (almost) always rename the original remote repository
upstream
.When I create a new repository that does not have a remote called origin:
Which is to be expected, since
git
itself also doesn't know. But I cannot tellbit
to use a differentupstream
.When I set an upstream repo for the
master
branchEverything works as expected.
The
--help
output hints at that you should be able to use a different upstream:But this command doesn't work