Search code examples
rgitrstudiogit-commitgit-push

Commit a large number of files in RStudio using GIT panel


In RStudio, if you are dealing with a directory that contains a large number of files, and you want to commit and push the recent changes (that you made on all of them) to your repository, the GUI Git component gets super slow and practically doesn't work. Any idea?


Solution

  • Of course you can ignore the GUI and stick to the command-line Git forever, but if you don't want, a quick jump to the command-line git would solve this problem for now.

    The temporary solution that I found is as follows:

    1. Click on the blue-gear icon on the GIT panel, inside RStudio.
    2. Select Shell (a terminal window will pup up!)
    3. Write the add and commit command in the terminal:

    {ATTENTION: The following command will commit changes on ALL files! You may want to use what is appropriate for your situation!}

        git add -A && git commit -m 'staging all files'
    
    1. Now you can go back to the GUI Git, and click on push button. All files that you staged in the terminal window, will be pushed up to your repository.