Publishing in GitHub

April 17, 2014

(This article was first published on MATHEMATICS IN MEDICINE, and kindly contributed to R-bloggers)

Publishing in GitHub

I struggled to make my first repository in GitHub. I finally found out the steps to do so.

  • Make your folder in local host and add the required files in the folder (SRCFOLDER). One of the required files is, which will contain overview of the project.
  • Add git to the SRCFOLDER. It will make a .git folder into the SRCFOLDER
$ SRCFOLDER git init
  • Add the files into the git.
$ SRCFOLDER git add *.*
  • Commit the files into git. The files will be committed with HEAD as master.
$ SRCFOLDER git commit -m "initial commit"
  • Make new repository in GitHub. It should be totally empty (sumprain/XXX).
  • Copy the https address of GitHub repository obtained from the right bottom of the repository page. It is
  • Clone the GitHub repository into SRCFOLDER. Cloning creates a copy of GitHub repository into SRCFOLDER as SCRFOLDER/XXX, and will have all the contents of the XXX into it including a .git folder. It gives a name origin to the remote source.
$ SRCFOLDER git clone
  • Push the contents of the SRCFOLDER into the sumprain/XXX. It will copy the contents of SRCFOLDER into sumprain/XXX.
$ SRCFOLDER git push origin master
  • In case of modification of contents in the SRCFOLDER, commit the changes and then run another push.


To leave a comment for the author, please follow the link and comment on his blog: MATHEMATICS IN MEDICINE. offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.