geraldiner / secret-santa-app

https://secret-santa-app-2023.vercel.app
0 stars 0 forks source link

Branch test practice #4

Closed geraldiner closed 9 months ago

geraldiner commented 9 months ago

Practice creating an issue branch and creating a PR to merge to staging.

1. Make sure you have the latest changes on main and staging.

In a terminal, run: git checkout main and then git pull. Then the same with staging: git checkout staging and then git pull.

2. Create the issue branch.

In the terminal, run git checkout -b 4/feat/branch-practice

With this command, you're telling git to go to a newly created branch called 4/feat/branch-practice.

Parts of the branch name:

-b is the flag that tells git to create the branch before switching to it.

4 is the number of the issue you're working on (you can see it above where it says "#4" after the issue title).

feat stands for "feature", as in you're adding something new to the project.

branch-practice is a short but descriptive name for the feature you're working on (generally the same or related to the issue title).

3. Make some changes.

Now make some simple changes, like adding an h1 tag that says "Hello, World!" to the index.html file. Don't forget to save.

4. Commit the changes to GitHub.

In the terminal, run the holy trinity:

git add . or git add -a (add all changed files) git commit -m "Add new heading to main page" (short but descriptive message about the changes) git push -u origin 4/feat/branch-practice

Since this is the first time you are pushing the branch, you need to use the -u flag. If you do more work, you won't have to. It would just look like git push.

5. Make another change and push to GitHub again.

Follow the steps above to add a lorem ipsum paragraph to the index.html file.

6. Open a Pull Request.

On the GitHub website, go to your branch and you might see something like a button that says "Compare & pull request". Click on that button.

The title should be auto-filled based on the branch name. But for the description, you want to add something like

"Closes #/4" (for features) "Fixes #/2" (for bugs)

But without the slash. I only used it here so it doesn't tag them.