49

What's the right way to rename an RStudio project (esp., when that project is under version control)?

E.g., I created an RStudio project with version control in "~/myproject". Then I decided I wanted to rename the project to "myproject1". So I

  1. renamed "~/myproject" as "~/myproject1"
  2. renamed "myproject.Rproj" as "myproject1.Rproj"
  3. committed the "rename" changes with git via RStudio.

Everything seems to be fine. But I have a suspicion I'm missing something and that I'm going to be surprised by some project behavior down the line.

lowndrul
  • 3,715
  • 7
  • 36
  • 54
  • 6
    FWIW it sounds like you've done everything correctly here. – Kevin Ushey Feb 07 '17 at 06:42
  • 7
    This was helpful, thanks. Since I also wanted to change the name of the GitHub repo, I used `git remote set-url origin [GitHub repo URL]` See here: [https://help.github.com/articles/changing-a-remote-s-url/](https://help.github.com/articles/changing-a-remote-s-url/) – jtr13 Aug 02 '17 at 15:40
  • For future travelers: If you made a README on repo initialization, you'll likely need to change the README.md header title as well – Kai Aragaki Jan 06 '22 at 15:36

1 Answers1

21

If your project is also an R package, you need to edit the DESCRIPTION file and change the value of "Package" property to reflect the new name.

mkhezr
  • 564
  • 5
  • 10