----- Original Message ----- 
  From: Jan Lee 
  To: Git for human beings 
  Sent: Tuesday, April 26, 2016 7:18 AM
  Subject: [git-users] Git Bash and R

  Hi. I have been learning about Git Bash for Widows for quite some time but am 
still confused about Git. I know that Git is used to create. name and navigate 
around directories/files. But where does the R programming code go? I know we 
are updating our project using Git Bash but how do we get a project into Git? 
If anyone can help I would be very grateful. Thanks. Jan.
Hi Jan,

I don't use R, but I do use Matlab (another script language). Here is how I use 
it there.

I will have a project folder (and sub-folders) that contains my data and 
scripts which is in various stages of development.

At the top level of the project I will do a 'git init' to create the .git 
repository (i.e. it is normally a hidden directory, and is part of the project 
folder, and does not take up excess space).

I then create or locate a .gitignore file for the project which allows you to 
ignore the chaff and irrelevant file types (there is a repository of them on 

I can now add the files I want to track to the project, and then commit them 
(note the two separate stages: adding files one at a time, then committing a 
nice package with a neat message). I typically use the Git Gui to help 
visualise what is happening (been working too long in the Windows visual 
environment ;-)

I can now try out some code. If its working (e.g. half a dozen lines of 
improvement) then I'll use the gui to rescan/add/message/commit, and build from 

This way you get a nice summary of all those little messages and notes, and can 
go back to any point in your development to recreate graphs and charts when you 
later realise you had something useful back then...  I use the gitk repository 
viewer to assist here. I've not needed anything beyond the basic install.

Then browse some of the Git books and vids. Have a look at how remotes work so 
that you can have separate copies in two places.



You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to