Skip to content

Commit

Permalink
Merge pull request open-learning-exchange#20 from EmilyLarkin/master
Browse files Browse the repository at this point in the history
Create Git and Repositories
  • Loading branch information
EmilyLarkin committed May 13, 2016
2 parents 0183f38 + edb267e commit 7f829d6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions ll_CC/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
[Github and Markdown](pages/githubandmarkdown.md)
[BeLL-Apps](pages/bellapps.md)
[GitHub Issues](pages/githubissues.md)
[Git Repositories](pages/gitandrepositories.md)
[Team](pages/team.md)
[Translation](https://crowdin.com/project/open-learning-exchange/invite)
[Chat](https://gitter.im/open-learning-exchange/chat)
Expand Down
25 changes: 25 additions & 0 deletions ll_CC/pages/gitandrepositories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
##Git Repositories

On GitHub, our software code is organized by repositories which are different sections of our software development. For example, you have been working one of the repositories: open-learning-exchange.github.io. I would strongly suggest looking (look, don't touch) through our different repositories on GitHub [here](https://github.com/open-learning-exchange).

As previously mentioned, you fork a repository to work on your own user and then send it back to the master repository in the form of a pull request to update it. You went through this process to fork open-learning-exchange.github.io and rename it to your own repository. Normally, we do not rename but as markdown wikis are slightly different, we renamed in the repository in that example.

Now, we will be using GitHub reposiitories on a command line, which means that there is a separate step to get your GitHub repository on your OS. Therefore, open a command line and open your username.github.io repository on GitHub. You then need to copy the link provided of the repository (seen in the picture below).

![GitHub Clone URL](/ll_CC/pages/uploads/images/githubcloneurl.png)

Then, turn to your command prompt and type your repository URL in the form of `git clone https://github.com/EmilyLarkin/EmilyLarkin.io.git` into the command line. You will use whichever URL you need to clone the proper repository; you will obviously not type mine. Now, you have created a clone of your repository on your OS. You know have three different levels of GitHub repositiory: open-learning-exchange.github.io, username.github.io, and your username.github.ion on your OS. It's important to try to keep these separate and not mix changes between them as you will be unable to fork and git push/pull if they are very different versions. An explanation on how to keep these repositories up to date is below.

As you create a fork from the original repository and then clone your forked repository onto your OS, you will need to update the fork continuously so that your fork and clone are not behind. Further, you need to sync your repository on your OS and on GitHub (username. github.io) with the master repository (open-learning-exchange.github.io). There are various ways to do this which I will detail below.

First, the GitHub help section and https://git-scm.com are incredibly helpful in answering your basic questions, including [this link](https://help.github.com/articles/syncing-a-fork/), which details how to sync a fork with the correct origin/master, because as you renamed your repository, it does not automatically assume that open-learning-exchange.github.io is the source.

I would begin by opening your command prompt/terminal and finding the correct directory: `cd username.github.io`. Then, use the command `git fetch upstream` to fetch branches and repositories from the upstream repository (in this case, it is open-learning-exchange.github.io). The check your fork's master branch with `git checkout master`. You should see some variation on this response:

`EmilyLarkin.github.io $ git checkout master
Already on 'master'
Your branch is up-to-date with 'origin/master'.`

Then, use `git pull` to receive any new updates from the master repository as this will sync your version to the master version. If you have uncommitted changes (from mixing interface and terminal use of GitHub repositories), then this command will be aborted until you fix the discrepancy.

You should also use the commands `git diff` and `git status` to respectively see the difference between the master and your repository and then see the status of your repository and the changes you have made. Once again, you need to sync your repository with the correct master first, otherwise you will not see the correct `git diff` and `git status`.
Binary file added ll_CC/pages/uploads/images/githubcloneurl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ll_CC/pages/uploads/images/vim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7f829d6

Please sign in to comment.