Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 244
Azim Avatar asked Apr 29 '17 01:04

Azim


People also ask

How do you add multiple files for commit in Git?

To add multiple files in Git, first, navigate to the directory where the untracked files are present and execute the “$ git add” command with the required files name. Then, use the “$ start” command to open added files one by one, make changes and save them.

What is the Git commit command?

The git commit command captures a snapshot of the project's currently staged changes. Committed snapshots can be thought of as “safe” versions of a project—Git will never change them unless you explicitly ask it to.


1 Answers

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.
like image 69
Azim Avatar answered Oct 20 '22 02:10

Azim