
Look in RStudio’s file browser pane for the README.md file. This should download the README.md file from GitHub. You should find yourself in a new local RStudio Project that represents your test repo on GitHub. VS Code will still show you changes you made but you can also commit and push them in Github Desktop. If you want to use Github Desktop you simply clone with it and then open the directory in VS Code. I suggest you check “Open in new session”, as that’s what you’ll usually do in real life. Both VS Code and GitHub Desktop are just graphic interfaces for git itself.A common rookie mistake is to have no idea where you are saving files or what your working directory is. Take charge of – or at least notice! – where the Project will be saved locally.myrepo, which coincides with the GitHub repo name. Accept the default project directory name, e.g.
Git vs github desktop how to#
Still no luck? Go to chapter 13 for tips on how to help RStudio find Git. Do you NOT see an option to get the Project from Version Control? Restart RStudio and try again.In “Repository URL”, paste the URL of your new GitHub repository. File > New Project > Version Control > Git.ġ2.3 Clone the test GitHub repository to your computer via RStudio Here’s how to do that in the shell, if current working directory is myrepo: cd. It’s just a regular directory on your computer. It’s a deeply pragmatic coping strategy if your local Git repo is goofed up, but the version on GitHub is pretty current.ĭelete the folder corresponding to the local repo any way you like. This is a actually a workflow we refer to elsewhere (see 37 as “burn it all down”.


However, I encourage you to delete the local repository, so you can experience how we use RStudio to clone it and get a local copy. If you just completed the previous chapter, Connect to GitHub, that repo will be perfect! If you don’t have a suitable test repository on GitHub, follow the instructions in the next section. You will also need a test repository on GitHub.
