Diary of a Broken Brain: Git Notes
Bear with me. I’m feeling frustrated with my perfectionism today, but I need to write something. I’m starting what might be a series to force something out of my fingers.
Git: Getting Started
There’s a set of instructions here: Git Notes: Getting Started that is my go-to when getting set up to contribute to someone else’s programming project. I usually go to this page, but instead am distilling it here. I want this site to be my (and maybe your) go-to.
I normally skip the first couple of steps in that article, as I already have git installed and I already have an account. I usually skip the configuration one because it’s generally done.
Step 1: Clone the Repo
If you want to contribute to someone else’s project, you’ll typically fork it to your GitHub account, then clone it to your local computer as the article says.
Step 2: Track the Main Project
How do we track the project that we’re helping on? Add it as a remote repository:
git remote add shuttle-hq git@github.com:shuttle-hq/shuttle.git
As an example, I’ve used the Shuttle repo. Following the above will add the remote location to your forked and cloned local repo as a place to track. It will fetch all
Step 4: Fetch from the Remote Repo
Get any changes from remote with:
git remote update
Then, to merge them do:
git merge shuttle-hq/main
Step 5: Merge the Remote Changes to Your Rep
Once you’ve got the changes merged, you can push them up to your repo on GitHub to get everything aligned:
git push origin main
This short guide is a bit quick and dirty, and some will feel I’ve skipped nuance and steps, but it gives you the basics. You can review the more fullsome guide at the link I provided above.
Thanks for reading, now go forth, help, and make some commits!
Comments