diff --git a/README.md b/README.md index eb81b2a..e40fe52 100644 --- a/README.md +++ b/README.md @@ -51,16 +51,26 @@ This process is called the *[feature branch workflow][atlassian-feature-branch-f We're going to create a pull request that contains two individual commits involving different files. -### Fork And Clone This Repository +### Clone This Repository -First, fork this repository to create your own copy. +Open VSCode (or your terminal) -- VSCode is recommended. Go to View -> Terminal to see your terminal (you can also "drag up" from the bar at the bottom of the screen). You will be typing the commands below into the terminal. When I open it, I see this: +```console +jocelynzhao@Jocelyns-MacBook-Pro ~ % +``` +This indicates that I am in my home repository. Running `ls` lists the files and folders in my home repository. In my base repository, I have a folder called Desktop. To go into my Desktop folder, I run `cd Desktop` which shows -Next, clone **your fork** using the `git clone` command. This will create a copy of your repository on your computer (called a *local copy*). +```console +jocelynzhao@Jocelyns-MacBook-Pro Desktop % +``` +I can continue navigating through my file storage system like this, until I find where I want to store my folder (I usually create a folder somewhere called SUBC and put all my SUBC related folders in there). Don't worry about doing this if it's too complicated though. -**Note**: Replace `YourGitHubUsername` with your *actual* GitHub username. + +Next, clone **your fork** using the `git clone` command. This will create a copy of your repository on your computer (called a *local copy*) that exists in your current folder. + +**Note**: Replace `link` with the link under the green (code) button at the top of the repository ```console -git clone https://github.com/YourGitHubUsername/exercises-git-pull-request.git +git clone link ``` This will create a directory named `exercises-git-pull-request` inside the current working directory. Enter the directory with the following command: @@ -69,6 +79,11 @@ This will create a directory named `exercises-git-pull-request` inside the curre cd exercises-git-pull-request ``` +You can now open this folder using VSCode. Press the file icon (Explorer), then press Open Folder. Navigate through your filesystem until you get to where you stored the folder `exercises-git-pull-request`. Select the `exercises-git-pull-request` folder and click open. This should load the folder into your VSCode. You will be able to add files and folders very easily by right-clicking on the left navigation bar. You can edit files by directly clicking on them, this should load the files into your main window. + +**Note**: at this point, you may need to reopen your terminal. You can do this the same way as described earlier. + + ### Create A Feature Branch When we're inside a git repository, there is always an "active" branch. To see a list of all the branches run: @@ -85,17 +100,17 @@ $ git branch $ ``` -Let's create a new branch and switch to it. Run the following: +Let's create a new branch and switch to it. Run the following, replacing your-name with your actual name: ```console -git checkout -b first-feature +git checkout -b your-name ``` Run `git branch` again and you should see: ```console $ git branch -* first-feature +* your-name master $ ``` @@ -104,10 +119,10 @@ $ **Note**: Remember to use commands like `ls` and `pwd` to verify you're in the correct directory and looking at the right files. -While on the `first-feature` branch, create a file named `hello.txt` that contains the following text: +While on the `your-name` branch, create a file named `hello.txt` that contains the following text: ```text -Hello! This is my first pull request. +Hello! This is my first pull request. My name is _____ ``` Make sure to save the file. In the console, run the following command: @@ -168,8 +183,10 @@ Run `git status` and note how the output changed. Right now, your branch exists on your machine but doesn't yet exist on GitHub. To simultaneously push your changes up to GitHub and create the branch on GitHub, run the following command: +Replace `branch_name` with the name of the branch (should be your name, or whatever you named it earlier) + ```console -git push --set-upstream origin first-feature +git push --set-upstream origin branch_name ``` Here `origin` refers to GitHub. @@ -182,22 +199,23 @@ On GitHub, you should see the following: -You have two ways to request a code review: +This is what the correct version looks like: +Screenshot 2024-08-17 at 10 41 52 PM -1. Add one or more instructors as collaborators on your project and then select them from the "Request Review" dropdown -1. Leave a comment `@`-mentioning anyone you want a code review from. If you want a review from GitHub user `SnorkleFish` then leave a comment that looks like: - ```text - @SnorkleFish I'd like a review! - ``` +Ta-da, first pull request! ## Merging Pull Request -Once you're ready to go, merge your pull request into the `master` branch. Don't wait for a review to merge unless you think it's critical. +You don't have to do this for this exercise, but it is good to know how to merge. +Once you're ready to go, merge your pull request into the `master` branch. There should be a green button that pops up on your pull request. You may need to have your code reviewed by another person first, depending on the rules for the repository. [github-fundamentals-i]: https://github.com/jfarmer/exercises-javascript-fundamentals [atlassian-feature-branch-flow]: https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow diff --git a/goodbye.txt b/goodbye.txt new file mode 100644 index 0000000..def298d --- /dev/null +++ b/goodbye.txt @@ -0,0 +1 @@ +Goodbye! About to submit my first pull request. diff --git a/hello.txt b/hello.txt new file mode 100644 index 0000000..7a59e63 --- /dev/null +++ b/hello.txt @@ -0,0 +1,2 @@ +Hello! This is me first file! +This is another try! \ No newline at end of file