Can't push git commit

Hi. I am able to stage and commit changes using R Studio, but the "Push Branch" menu option remains grayed out. I am able to push using the command prompt; it just won't work in R Studio for some reason. Any ideas about what's going on?
image

When things like this happen to me it's usually that something is poorly-defined in my remotes. To debug, I recommend the usethis function git_sitrep(). That function will actually give some suggestions for fixing issues if they are common, or the results of your sitrep could help us debug your setup further.

Hi Amelia, thanks for the suggestion. I downloaded the package and called the git_strep() function. Nothing sticks out to me, expect the missing email scopes. Could that be it?

> git_sitrep()

── Git global (user) 
• Name: 'matthewacarson'
• Email: 'github-carsonm@snkmail.com'
• Global (user-level) gitignore file: <unset>
• Vaccinated: FALSE
ℹ See `?git_vaccinate` to learn more
ℹ Defaulting to 'https' Git protocol
• Default Git protocol: 'https'
• Default initial branch name: 'master'

── GitHub user 
• Default GitHub host: 'https://github.com'
• Personal access token for 'https://github.com': '<discovered>'
• GitHub user: 'matthewacarson'
• Token scopes: 'gist, repo, workflow'
✖ Token lacks recommended scopes:
  - 'user:email': needed to read user's email addresses
  Consider re-creating your PAT with the missing scopes.
  `create_github_token()` defaults to the recommended scopes.
✖ Can't retrieve registered email addresses from GitHub.
  Consider re-creating your PAT with the 'user' or at least 'user:email' scope.

── Active usethis project: 'C:/Users/madou/OneDrive - UCLA IT Services/2)_2023_Fall/PS-170A/Minimum-Wage-Project' ──

── Git local (project) 
• Name: 'matthewacarson'
• Email: 'github-carsonm@snkmail.com'
• Default branch: 'main'
• Current local branch -> remote tracking branch:
  'main' -> '<unset>'

── GitHub project 
• Type = 'ours'
• Host = 'https://github.com'
• Config supports a pull request = TRUE
• origin = 'matthewacarson/Minimum-Wage-Project' (can push)
• upstream = <not configured>
• Desc = 'origin' is both the source and primary repo.

That all looks pretty good! I don't think it's the scopes, I often get a message like that if I've created the PAT myself without using create_github_token().

It's a little strange that you don't have an upstream in the GitHub project area, so that would be my first guess. This other community post says doing a manual push with -u will help enable the buttons, probably because it adds that upstream reference. I think you could also add an upstream with the use_git_remote() function from usethis.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.