-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When does push() set the upstream tracking branch? #375
Comments
I actually checked this behaviour myself in the past couple of days and, when we're talking about a push to Github, |
@jennybc Thanks for the confirmation! I'm struggling to figure out if it ever worked for me. I tried installing git2r 0.21.0, but observed this same behavior. I switch back and forth between git2r and Git so often, I'm thinking I may have just missed this the whole time. |
That's a very good question. I have studied the code and I can't find that the |
Yes, I think it would be great to expose this in a similar fashion as |
@stewid Yes, it would be useful to have that option. Though since it does appear to sometimes add the upstream tracking branch, the documentation should probably explain that |
The documentation for
push()
states that it adds an upstream tracking branch (source):And the unit tests confirm this behavior. Below I've copied line line 64 through line of 68 of
tests/push.R
followed by a test I added:However, for these unit tests, the remote repository is a local Git repository on the same machine. When I try to replicate this behavior when the remote repository is on GitHub, the upstream tracking branch is not set.
I checked the usethis package, and they also manually set the upstream tracking branch after running
git2r::push
(source):What is the expected behavior of
git2r::push()
in regards to setting the upstream tracking branch? Is it supposed to when the remote repository is hosted on GitHub or another online provider? If not, could the documentation be updated to describes the rules for when it does or doesn't set the upstream tracking branch?Potentially related: #133
The text was updated successfully, but these errors were encountered: