| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Practice using git + Github
This project will consist of three separate mini-projects to get you comfortable with the kinds of activities you'll be using git for throughout the class.
In the first mini-project, you'll be mimicking the steps you'll take when you first start your personal project. Creating a repository, linking it to your computer, then pushing those changes up to your GitHub.
In the second mini-project, you'll be mimicking the steps you'll take with nearly every DevMountain project you do. You'll 'fork' the DevMountain repository, link your computer with your fork, then push those changes up to your GitHub.
Finally, in the last mini-project you'll be mimicking the steps you'll take during the group project portion. You'll fork your group's repo, link your computer with your fork, push changes to your GitHub, then make a 'Pull Request' into your group's repo.
In this step we will create a repository on GitHUB.
In this step we will setup the origin for the repository. We'll do this by connecting code on our computer to the GitHub repository we just created.
You've just told your computer that you want git to watch the myProject folder and to keep track of any changes. This also allows us to run git commands inside of the folder. (Warning: Be very careful to make sure you're in the right directory when you run git init!)
Basically, we tell our computer "Hey, I created this repo on GitHub, so when I push, I want my code to go to this GitHub repo." Now whenever you run git push origin master your computer knows that origin is pointing to your repo you made on GitHub and it pushes your changes there.
( If you accidentally DID initialize your repository with a README, you must do a git pull origin master first - to get the README file on your computer - before you'll be able to push. )
In this step, we will push code to GitHub.
This will show what files have been changed. This also helps us determine what files we want to add to GitHub and what files we don't want to add to GitHub.
This will show the actual code that has been changed. Again, we want to make sure we don't push anything to GitHub that shouldn't be there.
This adds our file(s) to the 'staging area'. This is basically a fail safe if you accidentially add something you don't want. You can view items that our staged by running git status.
This tells your computer: 'Hey, the next time code is pushed to GitHub, take all of this code with it.' The message also specifies what GitHub will display in relation to this commit.
Your code is now pushed to GitHub. Be sure to include origin master, as this tells GitHub which branch you want to push to, and creates the branch if it doesn't exist yet.
In this step, we will fork this tutorial repository.
This will essentially copy all of the code from this repository, but make it as a new repository under your account. As you can imagine, you can't push directly to the DevMountain repo, because that would not be secure for DevMountain (anyone could make any changes they want). What you should do is create a fork of this repo, then push to your own fork because it's under your own account.
In this step, we will take the forked repository and clone it down to our machine.
This takes what's on GitHub and essentially downloads it so you can now make changes to it on your local computer.
In this step, we will make changes to our clone and push them to GitHub.
To help this process stick in memory we are going to repeat the process of the second project. We'll delete our current fork on our machine and restart the process.
Here is where things start to get different. Let's imagine we're working in groups. If we have everyone pushing to one repo without verifying the quality of the code, things can get messy pretty quick. GitHub fixed this solution with 'Pull Requests.' Basically, you fork a project, make changes to your fork, then you make a Pull Request (PR) back into the original project requesting that some piece of code be added to the original repo. This is how the vast majority of open source code projects work. In this step, we will make a pull-request.
If you see a problem or a typo, please fork, make the necessary changes, and create a pull request so we can review your changes and merge them into the master repo and branch.
© DevMountain LLC, 2017. Unauthorized use and/or duplication of this material without express and written permission from DevMountain, LLC is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to DevMountain with appropriate and specific direction to the original content.
| Back | FazBrowse Home | New Git URL |