An exercise in forking and creating a pull requests.
First, run through the below exercise to add your SSH key
- https://git.generalassemb.ly/ga-wdi-lessons/git-ssh If you cannot get it to work, then use HTTPS for the below instructions (#2)
- Practice using the 'fork, clone, and pull request' model to submit assignments
You do not have the necessary rights to update this repository. Therefore, you must fork it, make changes to your fork, and then send a pull request to the owners of this repository.
Set Up Instructions
- Fork this repo to your personal account.
- Copy the "SSH clone URL" for your fork of this repo.
- Clone the repository to your computer. Make sure to use the url for your fork, and not this original repo.
git clone firstname.lastname@example.org:adambray/haiku.git. The
git clonecommand will create a new
haikudir and download a copy of the repo there.
- Change directories to the newly created
git remote -v. You can see that
git cloneset up a remote named
originthat contains the clone URL you copied from your forked repository. This last step isn't necessary for setup but is to highlight what a
Starting in your directory
- Open the current directory in your text editor (
- Create a text file named
- Write a haiku on a topic of your choice, commit your changes, and push those changes with
- Make one more commit that removes only the content of your
.txtfile (do not delete the file).
- Undo the commit you just made. Thing to Google is "undo last commit". (Hint: look for
- Push the changes again to your remote.
originby default, should point to your fork of this repository.
- You should still see your original haiku on GitHub after pushing.
Submitting Your Completed Assignment
Create a Pull Request:
- Back on github.com (on your forked repo), create a pull request to the upstream (original) repository:
ga-wdi-exercises/haiku master <- your_github_name/haiku master.
Additional changes (commits) are added to the Pull Request, after being pushed:
- Make additional local changes, and commit/push them to your remote.
- Verify that the pull request is updated on GitHub with your most recent commits.
Oh No I cloned down the original repository!
Error: Your changes were rejected because you don't have push access.
No problem! This a chance to learn another useful
- Make sure you fork this repository to your GitHub Enterprise account.
Recall that forking creates a copy of a repository that belongs to another user to your own account
- Copy the clone URL to your clipboard.
- After you've done that, run the following command inside your
haikudirectory. Make sure to replace
git remote set-url origin <paste clone URL here>Note: Make sure to replace
<paste clone URL here>with the clone URL on your clipboard. This will set the
originto point to your forked repository, and not the original.
- Now when you run
git push origin master, it will push the changes to your forked repository, and not the original (this repo).