Publishing in GitHub

[This article was first published on MATHEMATICS IN MEDICINE, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Publishing in GitHub

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 README.md, which will contain overview of the project.
  • Add git to the SRCFOLDER. It will make a .git folder into the SRCFOLDER

$ SRCFOLDER git init<br />

  • Add the files into the git.

$ SRCFOLDER git add *.*<br />

  • Commit the files into git. The files will be committed with HEAD as master.

$ SRCFOLDER git commit -m "initial commit"<br />

  • 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 https://www.github.org/sumprain/XXX.
  • 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 https://www.github.org/sumprain/XXX<br />

  • 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<br />

  • In case of modification of contents in the SRCFOLDER, commit the changes and then run another push.

Thanks.

To leave a comment for the author, please follow the link and comment on their blog: MATHEMATICS IN MEDICINE.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)