Post

1 follower Follow
0
Avatar

It seems that if git remote was specified at the command line, that it's not reflected in the RStudio UI

So here's what I've run into twice, on two different RStudio server instances:

Apparently, if at the command line I specify "origin" for git, even though the RStudio versioning interface appropriately populates the "Project Options -> Version Control -> Origin" field with a remote address, e.g. "ssh://git@bitbucket.org/johndoe/foo.git", if I try to "Push" or "Pull" using the UI in either the the "Git -> More" menu or via the "Git -> Commit" window, they are greyed out.

Ian Pylvainen

Please sign in to leave a comment.

4 comments

0
Avatar

Push and pull will be disabled if the current branch does not have a tracking branch on origin. In other words, if you do git config --list it should have both branch.*branchname*.remote and branch.*branchname*.merge present. Let us know if you have both of these values set and it still doesn't work, thanks!

Ian Pylvainen 0 votes
0
Avatar

Joe,
Thanks for the help. If indeed those values are set, things work. Is there a way to "gracefully" do this? (I ended up pasting those values in from a git clone on another machine)

Ian Pylvainen 0 votes
0
Avatar

For recent-ish versions of git, there are two scenarios that I know of where git will gracefully do the right thing for you.

If origin has branch foo but it doesn't exist in your local repo, then the first time you git checkout foo should create the relationship for you (it will echo Branch *foo* set up to track remote branch *foo* from origin.).

If you have a local branch foo that doesn't exist on origin yet, then if you add the -u flag when you push (e.g. git push -u origin foo) then the relationship will be created for you.

If you already have a local branch foo, and there's already an origin/foo branch, then the only way I know is to edit those config values manually.

Ian Pylvainen 0 votes