Hi Martin,
I think the recommended solution from GitHub is to use a Personal Access Token (PAT) instead of a password for authentication. These Personal Access Tokens can be managed in your GitHub account settings.
The other option would be to configure an SSH key for your GitHub account. You can save this SSH key in the home directory for your project. If you've not used SSH keys before, this might be a little tricky, so I would probably consider using the PAT. Also note: one downside here is that on RStudio Cloud home directories are not shared between projects, so you would need to configure the SSH key on each project where you want to push/pull from GitHub.