For this assignment, you are going to create a new web page to add to an existing website in my GitHub account. To do this, you will clone my repository, create a branch for your changes, and then create a pull request to merge your changes back to my public repo.
- Fork this repository by clicking the "Fork" button in GitHub. This will create a copy of this repository with its complete history as a new repository in your account.
- Clone the repository to your computer. Do this by clicking the green "Code" button in the repository, select "SSH", and copy the URL that will look something like this:
[email protected]:my-username/repository.git
. Once you have that URL copied, open the Git Bash terminal in yourProjects
folder. Once open, run the "git clone" command with the copied git URL:git clone <paste your copied repository here>
- Open VSCode. Select
File
->Open Folder
and open theAssignment2
folder which should have been created when step 2 is complete. - Create a branch for your changes. Do this by clicking on the
Main
branch name in the bottom left corner of VSCode. This will open VSCode'sCommand Palette
at the top center of the program. Here you will see an option toCreate new branch\
. Select that and type a unique branch name so that we don't end up with conflicts for this exercise. An easy thing to do here would be to include your username in the branch name. For example, I might name minehayatae-new-page
. The branch name can not contain spaces. Once you've selected a name, hit the enter key. This will create the branch for you and make it your active branch which you can see in the bottom left corner of VSCode. - Create a new html page! Again, to avoid conflicts for this exercise, name the page something that includes your user name. In a more practical example, we'd all be creating different pages for different topics, but I'm not coordinated enough to organize that at the moment. :D So create something like
gale-page.html
. Here, feel free to add any content you'd like. - Edit the existing
index.html
page and add a link to your new page! - Save all files and try it out by opening the
index.html
page in your browser. You should be able to click your link to go to your page. You could also add a link on your page to go back to the home page likegale-page.html
has. - Commit your changes to your branch and push the changes. Don't forget to write a good commit message!
- Go to GitHub and open your fork of the repository. Click on the
Pull requests
tab. You should see an orange banner at the top noting that your branch had recent pushes and a green button forCompare & pull request
. Click this button. You should see that it's prompting you to create a pull request for merging from your branch in your fork into the main branch of the base repository in my account. - Feel free to enter a comment or leave blank and hit the green
Create pull request
button. - Congratulations! You've made your first pull request! We'll review and merge these pull requests in the next class and review this process.