Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] First pass proof-read of best practices lessons #42

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
*.pyc
*~
.DS_Store
.idea
.ipynb_checkpoints
.sass-cache
__pycache__
_site
.Rproj.user
.jekyll-cache/
.jekyll-cache/
66 changes: 40 additions & 26 deletions _episodes/01-package-setup.md

Large diffs are not rendered by default.

100 changes: 56 additions & 44 deletions _episodes/02-git.md

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions _episodes/03-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ questions:
objectives:
- "Explain reasons to use GitHub."

keypoints:
key points:
eirrgang marked this conversation as resolved.
Show resolved Hide resolved
- "You can use GitHub to store your project online where you or others can access it from a central repository."
- "You can use GitHub to store your projects so you can work on them from multiple computers."
- "You can use GitHub to store your projects so that you can work on them from multiple computers."

---

*TODO: Consider how to handle redundancy with lesson 2.*

## Putting your repository on GitHub.
Now, let's put this project on GitHub so that we can share it with others. In your browser, navigate to `github.com`. Log in to you account if you are not already logged in. On the left side of the page, click the green button that says `New` to create a new repository. Give the repository the name `molecool`.
Now, let's put this project on GitHub so that we can share it with others. In your browser, navigate to [github.com](https://github.com/). Log in to you account if you are not already logged in. On the left side of the page, click the green button that says `New` to create a new repository. Give the repository the name `molecool`.

Note for the last question, "Initialize this repository with a README". We will leave this unchecked in our case because we have an existing repository (as described by GitHub, "This will let you immediately clone the repository to your computer. Skip this step if you’re importing an existing repository."). If you were creating the repository on GitHub, you would select this. There are also options for adding a `.gitignore` file or a license. However, since cookiecutter created these for us, we will not add them.
Note for the last question, "Initialize this repository with a README". We will leave this unchecked in our case because we have an existing repository (as described by GitHub, "This will let you immediately clone the repository to your computer. Skip this step if you’re importing an existing repository."). If you were creating the repository on GitHub, you would select this. There are also options for adding a `.gitignore` file or a license. However, since `cookiecutter` created these for us, we will not add them.

Click `Create repository`.

Expand All @@ -33,7 +35,7 @@ $ git remote -v
You should see no output. Now, follow the instructions on GitHub under "...or push an existing repository from the command line"
~~~
$ git remote add origin https://github.com/YOUR_GITHUB_USERNAME/molecool.git
dgit branch -M main
git branch -M main
git push -u origin main
~~~
{: .language-bash}
Expand All @@ -50,7 +52,7 @@ Now if you refresh the GitHub webpage you should be able to see all of the new f

One of the most potentially frustrating problems in software development is keeping track of all the different copies of the code.
For example, we might start a project on a local desktop computer, switch to working on a laptop during a conference, and then do performance optimization on a supercomputer.
In ye olden days, switching between computers was typically accomplished by copying files via a USB drive, or with ssh, or by emailing things to oneself.
In ye olden days, switching between computers was typically accomplished by copying files via a USB drive, or with `ssh`, or by emailing things to oneself.
After copying the files, it was very easy to make an important change on one computer, forget about it, and go back to working on the original version of the code on another computer.
Of course, when collaborating with other people these problems get dramatically worse.

Expand All @@ -74,14 +76,15 @@ If you do not get this message, do `cd ../` until you see it.

Next, make another copy of your repository. We'll use this to simulate working on another computer.

*TODO: use `git://` URL or discuss other authentication methods.*
~~~
$ git clone https://github.com/YOUR_GITHUB_USERNAME/molecool.git molecool_friend
$ cd molecool_friend
~~~
{: .bash}

Check the remote on this repository. Notice that when you clone a repository from GitHub, it automatically has that repository listed as `origin`, and you do not have to add
the remote the way we did when we did not clone the repository.
the remote the way we did when we created the repository locally.

~~~
$ git remote -v
Expand Down
Loading