Skip to content

Commit

Permalink
syncing changes across branches
Browse files Browse the repository at this point in the history
  • Loading branch information
runner authored and runner committed Aug 7, 2023
1 parent 9459b30 commit ea92693
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,26 @@ To start:
* Return to your web browser and navigate to the lesson you want to download
* Click the GitHub icon

<img src="images/learn_github_logo.png">
<img src="https://curriculum-content.s3.amazonaws.com/data-science/images/learn_github_logo.png
">


You'll be redirected to the associated github repository like this.
<img src="images/github_fork_button.png">
<img src="https://curriculum-content.s3.amazonaws.com/data-science/images/github_fork_button.png
">

* **Click the fork button**, as shown above in order to create a copy to your personal account which you can edit and update.

After a moment of this:

<img src="images/github_forking_in_progress.png" width="650">
<img src="https://curriculum-content.s3.amazonaws.com/data-science/images/github_forking_in_progress.png
" width="650">


You'll be redirected to your new personal copy of the repository:

<img src="images/forked_github_page.png" width="850">
<img src="https://curriculum-content.s3.amazonaws.com/data-science/images/forked_github_page.png
" width="850">

## `git clone`

Expand Down
1 change: 1 addition & 0 deletions dsc-github-actions-files
Submodule dsc-github-actions-files added at 13d7a0
2 changes: 1 addition & 1 deletion index.ipynb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["# Getting Started with Git\n", "\n", "## Introduction \n", "As you now know, Git is a version control system. The Learn platform at Flatiron school has a deep integration with Git and GitHub. GitHub is an online hosting platform that uses Git. We need to teach you just enough Git to interact with GitHub like a real developer. While you can run Python notebooks on the Learn platform itself, you'll also want to be able to download material to your local computer so you can work on it there.\n", "\n", "## Objectives\n", "\n", "You will be able to:\n", "\n", "* Describe the difference between a forked and a cloned respository\n", "* Use `git clone` to clone a repository\n", "* Use `git add`, `git commit`, and `git push` to make changes to a repository\n", "* Compare local and remote repositories\n", "\n", "\n", "## Some terminology and concepts\n", "\n", "As you can see from the objectives above, we're going to dive in and use several Git commands in this lesson. \n", "\n", "The first thing we'll look at is *forking*, a concept from the GitHub platform.\n", "\n", "Forking is the process of making a personal copy of the Learn lab on GitHub. It's basically how you tell Learn that you have started working on a lab.\n", "\n", "![What's a Fork](http://ironboard-curriculum-content.s3.amazonaws.com/front-end/lab-assets/git-workflow-1.png)\n", " \n", "Afterward, we'll then use `git clone` from a bash shell like terminal or git bash in order to copy the material from the web to our local computer.\n", "\n", "From there, Git will allow us to continue to track and incorporate changes that we make to our work. \n", "\n", "`git status` allows us to see if we have made any changes.\n", "\n", "If we have made changes that we would like to save to our version control history, we can then use `git add` to add the changed files to the version history and `git commit` to finalize the process. Finally, we can then use `git push` to push our changes to the web so that we or collaborators can access them from anywhere. \n", "\n", "Now that you have a brief overview of what we're about to dive into, let's go through the process step by step.\n", "\n", "## Open up a Bash Shell and Create a Course Folder / Subfolder\n", "\n", "To use Git, we're going back to the bash shell (mac: terminal, windows: git bash) once again!\n", "To start:\n", "\n", "* Create a folder on your computer for your course materials and navigate into it (preferably using `mkdir` and `cd`) \n", "* Then create a subfolder titled \"Section1\", \"Bash_and_Git\" (or whatever you find to be an appropriate title) and navigate into that \n", "* Return to your web browser and navigate to the lesson you want to download \n", "* Click the GitHub icon\n", "\n", "<img src=\"images/learn_github_logo.png\">\n", "\n", "\n", "You'll be redirected to the associated github repository like this. \n", "<img src=\"images/github_fork_button.png\">\n", "\n", "* **Click the fork button**, as shown above in order to create a copy to your personal account which you can edit and update.\n", "\n", "After a moment of this:\n", "\n", "<img src=\"images/github_forking_in_progress.png\" width=\"650\">\n", "\n", "\n", "You'll be redirected to your new personal copy of the repository:\n", "\n", "<img src=\"images/forked_github_page.png\" width=\"850\">\n", "\n", "## `git clone`\n", "\n", "Now that you have your own copy (by forking), we're going to download this copy to your local computer using `git clone`.\n", "\n", "* Copy the URL \n", " * Mac: Press **cmd+L** to highlight the url bar and **cmd+c** to copy the url\n", " * Windows: Press **Ctrl+L** to highlight the url bar and **Ctrl+c** to copy the url\n", "\n", "* Return to your bash shell\n", "\n", "* Type: **git clone** and paste your repo url (**cmd + v** or **Ctrl+V**)\n", "\n", "** Voila! **\n", "\n", "The repository and all of its contents will be downloaded locally to your computer!\n", "\n", "You should be able to see the new folder by listing the files in the current directory with `ls`. \n", "You can then navigate into the git directory with `cd directory_name`.\n", "\n", "Now that you have a local copy, we can further investigate some more Git commands for version control. **Note that for these to work you must be in the git folder (the one you just cloned above). Make sure to navigate into the folder using the `cd` command.**\n", "\n", "## `git status`\n", "\n", "Once you have a Git repository downloaded locally, Git will keep track of every change you make to the code in that folder. You can ask Git what the differences or changes you've made since the last commit by typing `git status` into your terminal.\n", "\n", "It's really helpful to constantly get the status from Git to see what changes you need to stage, add, commit, or push.\n", "\n", "## `git add`\n", "\n", "Adding changes with the `git add` command is a way to stage any changes and get them ready to be a permanent record in your Git log via a commit. The workflow worth memorizing right now is to simply add all your changes via `git add .`.\n", "\n", "## `git commit`\n", "\n", "A commit is a permanent moment in time in your Git history. A commit creates a new version of your code. To commit, memorize this command. `git commit -am \"Your commit message\"`. You are using the `git commit` command with the flags `-am`, which tell Git to commit all the changes and to include a commit message. You supply the commit message in `\"\"` directly in the command, `\"Your commit message\"`.\n", "\n", "\n", "## `git push`\n", "\n", "Pushing is the process of taking your local code and commits and syncing them, or uploading them, to GitHub. You're updating the GitHub remote (remotes are just fancy names for copies of the repository), generally your fork, represented by a remote named `origin`, by pushing your code to the remote. The Git command to do this is simply `git push`. When you `git push` from within a Git repository, it will take all the commits that you have locally and push them to the online remote.\n", "\n", "\n", "## Additional Resources\n", "\n", "- [Git Cheatsheet](https://www.git-tower.com/blog/git-cheat-sheet/) \n", "\n", "- [Git Best Practices](https://www.git-tower.com/learn/git/ebook/en/command-line/appendix/best-practices) \n", "\n", "- [Understanding the GitHub Flow](https://guides.github.com/introduction/flow) \n", "\n", "- [Hello World GitHub](https://guides.github.com/activities/hello-world) \n", "\n", "- [Forking on GitHub](https://guides.github.com/activities/forking) \n", "\n", "- [Git - The Simple Guide](http://rogerdudler.github.io/git-guide/) \n", "\n", "- [Git Immersion](http://gitimmersion.com/) \n", "\n", "- [Try Git](http://try.github.com/) \n", "\n", "<p data-visibility='hidden'>View <a href='https://learn.co/lessons/enough-git-for-learn-co' title='Enough Git for Learn'>Enough Git for Learn</a> on Learn.co and start learning to code for free</p> \n", "\n", "## Summary\n", "\n", "In this lesson, we took an introductory look at Git and GitHub. First, we saw how to fork and clone repositories from Learn onto your local machine. From there, we then further discussed how to add changes to git, commit them, and push them online."]}], "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "toc": {"base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false}}, "nbformat": 4, "nbformat_minor": 2}
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["# Getting Started with Git\n", "\n", "## Introduction \n", "As you now know, Git is a version control system. The Learn platform at Flatiron school has a deep integration with Git and GitHub. GitHub is an online hosting platform that uses Git. We need to teach you just enough Git to interact with GitHub like a real developer. While you can run Python notebooks on the Learn platform itself, you'll also want to be able to download material to your local computer so you can work on it there.\n", "\n", "## Objectives\n", "\n", "You will be able to:\n", "\n", "* Describe the difference between a forked and a cloned respository\n", "* Use `git clone` to clone a repository\n", "* Use `git add`, `git commit`, and `git push` to make changes to a repository\n", "* Compare local and remote repositories\n", "\n", "\n", "## Some terminology and concepts\n", "\n", "As you can see from the objectives above, we're going to dive in and use several Git commands in this lesson. \n", "\n", "The first thing we'll look at is *forking*, a concept from the GitHub platform.\n", "\n", "Forking is the process of making a personal copy of the Learn lab on GitHub. It's basically how you tell Learn that you have started working on a lab.\n", "\n", "![What's a Fork](http://ironboard-curriculum-content.s3.amazonaws.com/front-end/lab-assets/git-workflow-1.png)\n", " \n", "Afterward, we'll then use `git clone` from a bash shell like terminal or git bash in order to copy the material from the web to our local computer.\n", "\n", "From there, Git will allow us to continue to track and incorporate changes that we make to our work. \n", "\n", "`git status` allows us to see if we have made any changes.\n", "\n", "If we have made changes that we would like to save to our version control history, we can then use `git add` to add the changed files to the version history and `git commit` to finalize the process. Finally, we can then use `git push` to push our changes to the web so that we or collaborators can access them from anywhere. \n", "\n", "Now that you have a brief overview of what we're about to dive into, let's go through the process step by step.\n", "\n", "## Open up a Bash Shell and Create a Course Folder / Subfolder\n", "\n", "To use Git, we're going back to the bash shell (mac: terminal, windows: git bash) once again!\n", "To start:\n", "\n", "* Create a folder on your computer for your course materials and navigate into it (preferably using `mkdir` and `cd`) \n", "* Then create a subfolder titled \"Section1\", \"Bash_and_Git\" (or whatever you find to be an appropriate title) and navigate into that \n", "* Return to your web browser and navigate to the lesson you want to download \n", "* Click the GitHub icon\n", "\n", "<img src=\"https://curriculum-content.s3.amazonaws.com/data-science/images/learn_github_logo.png\n", "\">\n", "\n", "\n", "You'll be redirected to the associated github repository like this. \n", "<img src=\"https://curriculum-content.s3.amazonaws.com/data-science/images/github_fork_button.png\n", "\">\n", "\n", "* **Click the fork button**, as shown above in order to create a copy to your personal account which you can edit and update.\n", "\n", "After a moment of this:\n", "\n", "<img src=\"https://curriculum-content.s3.amazonaws.com/data-science/images/github_forking_in_progress.png\n", "\" width=\"650\">\n", "\n", "\n", "You'll be redirected to your new personal copy of the repository:\n", "\n", "<img src=\"https://curriculum-content.s3.amazonaws.com/data-science/images/forked_github_page.png\n", "\" width=\"850\">\n", "\n", "## `git clone`\n", "\n", "Now that you have your own copy (by forking), we're going to download this copy to your local computer using `git clone`.\n", "\n", "* Copy the URL \n", " * Mac: Press **cmd+L** to highlight the url bar and **cmd+c** to copy the url\n", " * Windows: Press **Ctrl+L** to highlight the url bar and **Ctrl+c** to copy the url\n", "\n", "* Return to your bash shell\n", "\n", "* Type: **git clone** and paste your repo url (**cmd + v** or **Ctrl+V**)\n", "\n", "** Voila! **\n", "\n", "The repository and all of its contents will be downloaded locally to your computer!\n", "\n", "You should be able to see the new folder by listing the files in the current directory with `ls`. \n", "You can then navigate into the git directory with `cd directory_name`.\n", "\n", "Now that you have a local copy, we can further investigate some more Git commands for version control. **Note that for these to work you must be in the git folder (the one you just cloned above). Make sure to navigate into the folder using the `cd` command.**\n", "\n", "## `git status`\n", "\n", "Once you have a Git repository downloaded locally, Git will keep track of every change you make to the code in that folder. You can ask Git what the differences or changes you've made since the last commit by typing `git status` into your terminal.\n", "\n", "It's really helpful to constantly get the status from Git to see what changes you need to stage, add, commit, or push.\n", "\n", "## `git add`\n", "\n", "Adding changes with the `git add` command is a way to stage any changes and get them ready to be a permanent record in your Git log via a commit. The workflow worth memorizing right now is to simply add all your changes via `git add .`.\n", "\n", "## `git commit`\n", "\n", "A commit is a permanent moment in time in your Git history. A commit creates a new version of your code. To commit, memorize this command. `git commit -am \"Your commit message\"`. You are using the `git commit` command with the flags `-am`, which tell Git to commit all the changes and to include a commit message. You supply the commit message in `\"\"` directly in the command, `\"Your commit message\"`.\n", "\n", "\n", "## `git push`\n", "\n", "Pushing is the process of taking your local code and commits and syncing them, or uploading them, to GitHub. You're updating the GitHub remote (remotes are just fancy names for copies of the repository), generally your fork, represented by a remote named `origin`, by pushing your code to the remote. The Git command to do this is simply `git push`. When you `git push` from within a Git repository, it will take all the commits that you have locally and push them to the online remote.\n", "\n", "\n", "## Additional Resources\n", "\n", "- [Git Cheatsheet](https://www.git-tower.com/blog/git-cheat-sheet/) \n", "\n", "- [Git Best Practices](https://www.git-tower.com/learn/git/ebook/en/command-line/appendix/best-practices) \n", "\n", "- [Understanding the GitHub Flow](https://guides.github.com/introduction/flow) \n", "\n", "- [Hello World GitHub](https://guides.github.com/activities/hello-world) \n", "\n", "- [Forking on GitHub](https://guides.github.com/activities/forking) \n", "\n", "- [Git - The Simple Guide](http://rogerdudler.github.io/git-guide/) \n", "\n", "- [Git Immersion](http://gitimmersion.com/) \n", "\n", "- [Try Git](http://try.github.com/) \n", "\n", "<p data-visibility='hidden'>View <a href='https://learn.co/lessons/enough-git-for-learn-co' title='Enough Git for Learn'>Enough Git for Learn</a> on Learn.co and start learning to code for free</p> \n", "\n", "## Summary\n", "\n", "In this lesson, we took an introductory look at Git and GitHub. First, we saw how to fork and clone repositories from Learn onto your local machine. From there, we then further discussed how to add changes to git, commit them, and push them online."]}], "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "toc": {"base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false}}, "nbformat": 4, "nbformat_minor": 2}

0 comments on commit ea92693

Please sign in to comment.