-
Notifications
You must be signed in to change notification settings - Fork 4
Github features
When sharing the same repository and modifying the same document/code it's important to stay current with changes made by you and others.
Luckily this is where github comes in!
Having made it this far you're probably wondering why we are using github
Github has 2 main features that we will use:
- Automatic merging, and
- Tracking changes
Here is a little explanation of how this all works Github is the place we are storing our remote repository. This is where we will centralise. When you created your new R project you created a copy or cloned the repository to make it local to your machine. We then made some changes, these changes occurred locally which makes us a step ahead of the remote repository. We now want to keep the remote repository up-to-date
#Adding new changes Before we can update the remote repository we need to tell git that we have added something new to the local repository
- From the git menu select commit
This new window shows you the files that you have created/changed. The top left panel lists the new/modified files. The top right panel is where we can write a summary of what we changed, and the bottom panel shows us the difference between the old and new files if they have been changed. Green signifies insertions and red signifies deletions from what was previously in the file - our track changes. In the top right corner are two buttons called "Pull" and "Push"
Lets now add our example Rmd file and the into the repository.
- click the tick box next to your Rmd file
- Write a commit message about adding your file and click commit
Writing a commit message helps people understand quickly what you have changed
- github requires this message before you can update the repository
Your Rmd file has now been added into the local repository.
#Keeping current Before we update the remote repository we need to make sure that our local repository is at least up-to-date with the remote.
##Pull The operation to update your local repository is called pull
- Click the Pull button You have now made sure that you have all the changes that may have been done since you last updated your local repository. Through the magic of git the updated files will be merged into your local repository.
##Push The operation to update the remote repository is called push
Now we're up-to-date with the remote repository we can push our changes so that others can stay up-to-date with you.
- Click the Push button
make sure to PULL before you PUSH
Now everything is up-to-date and github has now updated the versions so that if need be can return to a previous version.
You can perform this commit / pull / push cycle as many times as you like but is best to do once you have your changes working locally
To learn about editing the wiki [continue here](Edit the Wiki)