An Interest In:
Web News this Week
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
Hacktoberfest 2021! My second contribution
On the second week of October, I made another Pull Request(PR). I will introduce the project and also my big mistake
Project
This project was a meditation app created on React.JS and bootstrapped with Create React App.
Project Repo: https://github.com/akshat157/meditate-app
Issue
The issue was changing the fonts, one of the owners of the repository said that the current font looks outdated.
Issue: https://github.com/akshat157/meditate-app/issues/32
What I did
I opened the Google Fonts and looked at the many fonts. I wasn't very confident because I hadn't studied the design side, but I chose Barlow and Maven Pro fonts because they are easy to read and they don't look like the default fonts.
Pull Request
I was going to make a PR... BUT...!
I had a problem
The CONTRIBUTE.md says not to push to main branch but I did it...
I was going to delete my forked repo and the branch and make everything restart. However, I chose to contact to
Professorrrrrrrr for a better understanding. He helped me right away and told me how to do it.
How did I solve it?
First of all, he suggested I do the below commands:
$git checkout -B issue-32 c9dbd88$git checkout main$git pull upstream main$git checkout issue-32$git rebase main
However, my push and merge was still there like below:
PS C:\Users\Mizuho\meditate-app> git checkout -B issue-32 c9dbd88Switched to and reset branch 'issue-32'PS C:\Users\Mizuho\meditate-app> git checkout mainSwitched to branch 'main'Your branch is up to date with 'origin/main'.PS C:\Users\Mizuho\meditate-app> git pull upstream mainFrom https://github.com/akshat157/meditate-app * branch main -> FETCH_HEAD * [new branch] main -> upstream/mainwarning: refname 'd327d53e852a17353ecb297da2f819ac7bceee0f' is ambiguous.Git normally never creates a ref that ends with 40 hex charactersbecause it will be ignored when you just specify 40-hex. These refsmay be created by mistake. For example, git switch -c $br $(git rev-parse ...) where "$br" is somehow empty and a 40-hex ref is created. Please examine these refs and maybe delete them. Turn this message off by running "git config advice.objectNameWarning false"Already up to date.PS C:\Users\Mizuho\meditate-app> git checkout issue-32Switched to branch 'issue-32'PS C:\Users\Mizuho\meditate-app> git rebase mainFirst, rewinding head to replay your work on top of it...Fast-forwarded issue-32 to main.PS C:\Users\Mizuho\meditate-app> git statusOn branch issue-32nothing to commit, working tree cleanPS C:\Users\Mizuho\meditate-app> git logMerge: d327d53 c9dbd88Author: MizuhoOkimoto <[email protected]> Merge branch 'issue-32' into maincommit c9dbd884650c1a1abb324822d8d08e1fd7521eaeAuthor: MizuhoOkimoto <[email protected]>Date: Fri Oct 15 18:14:45 2021 -0400 Add font family Barlow and Maven Pro
He pointed out that I didn't make a remote(!). I just created a branch. I made a new branch and used pull command to fetch and merge to the 'dev' branch, and rebased it.
PS C:\Users\Mizuho\meditate-app> git checkout devSwitched to branch 'dev'Your branch is up to date with 'origin/dev'.PS C:\Users\Mizuho\meditate-app> git pull upstream devFrom https://github.com/akshat157/meditate-app * branch dev -> FETCH_HEAD * [new branch] dev -> upstream/devAlready up to date.PS C:\Users\Mizuho\meditate-app> git checkout issue-32Switched to branch 'issue-32'PS C:\Users\Mizuho\meditate-app> git rebase devCurrent branch issue-32 is up to date.PS C:\Users\Mizuho\meditate-app> git push origin issue-32Total 0 (delta 0), reused 0 (delta 0)remote:remote: Create a pull request for 'issue-32' on GitHub by visiting:remote: https://github.com/MizuhoOkimoto/meditate-app/pull/new/issue-32remote:To https://github.com/MizuhoOkimoto/meditate-app.git
I switched to main($git checkout main
) and did $git log
, but main was still head to my push. He told me to do that with the capital -B command:
PS C:\Users\Mizuho\meditate-app> git checkout -B main upstream/mainReset branch 'main'warning: refname 'd327d53e852a17353ecb297da2f819ac7bceee0f' is ambiguous.Git normally never creates a ref that ends with 40 hex charactersbecause it will be ignored when you just specify 40-hex. These refsmay be created by mistake. For example, git switch -c $br $(git rev-parse ...)where "$br" is somehow empty and a 40-hex ref is created. Pleaseexamine these refs and maybe delete them. Turn this message off byrunning "git config advice.objectNameWarning false"Branch 'main' set up to track remote branch 'main' from 'upstream'.Your branch is behind 'origin/main' by 3 commits, and can be fast-forwarded.
$git log on main branch...
My push and merge on the main branch was gone!
I could finally made a PR.
PR: https://github.com/akshat157/meditate-app/pull/35
Conclusion
I wasn't careful with this PR and I made a mistake. Even though I learned about amend and rebase that week when it happened. However, I panicked and couldn't solve it by myself. Next time, I definitely will read the contribution section more carefully!
Happy Hacktoberfest!
(Photo by David Libeert on Unsplash)
Original Link: https://dev.to/okimotomizuho/hacktoberfest-2021-my-second-contribution-50nl
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To