<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Benji Andrews on Medium]]></title>
        <description><![CDATA[Stories by Benji Andrews on Medium]]></description>
        <link>https://medium.com/@baandr22?source=rss-d19a155e54ca------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*RvvxN4WJyecBKmOu.jpg</url>
            <title>Stories by Benji Andrews on Medium</title>
            <link>https://medium.com/@baandr22?source=rss-d19a155e54ca------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 17:22:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@baandr22/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Github isn’t Scary.]]></title>
            <link>https://medium.com/@baandr22/github-isnt-scary-55bff0e9123a?source=rss-d19a155e54ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/55bff0e9123a</guid>
            <dc:creator><![CDATA[Benji Andrews]]></dc:creator>
            <pubDate>Wed, 11 May 2022 04:20:41 GMT</pubDate>
            <atom:updated>2022-05-11T04:20:41.379Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to organize your programming project well in 16 minutes or less.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SvFnRAVgxeB38bTQ4h2png.jpeg" /><figcaption>source: github.com</figcaption></figure><p>If you’re anything like me, you’ve probably used Google Drive to manage your source code at some point in your life. There’s no shame, everyone starts somewhere. But at some point in your time as a programming-adjacent person, you hear those dreaded words for the first time:</p><blockquote>Y’know, you should probably just set up a Github repository…</blockquote><p>They aren’t wrong! But it can certainly seem daunting. So I’ve gathered my approximation of the process. I’m going to talk about what git is in the first place, how I have learned to use it in my projects, and some helpful commands to get you out of sticky situations. This is NOT an all-inclusive, step by step tutorial. There’s tons of places you can learn about this stuff in a structured environment, and if that’s your learning style try <a href="https://www.freecodecamp.org/news/git-and-github-crash-course/">here</a> or <a href="https://www.codecademy.com/learn/learn-git">here</a>.</p><p>First things first: Git != Github. Git is the source code management (SCM) tool <a href="https://en.wikipedia.org/wiki/Git">made by Linus Torvalds in 2005</a>. It’s an open source tool that tracks file changes in an innovative, efficient way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*0o9GZUzXiNnI4poEvxvy8g.png" /><figcaption>source: xkcd.com</figcaption></figure><p>Many tools exist that use Git to create an online source code management library, the most popular of which is Github. That’s what I’ll be talking about using today. What source code management tools allow us to do is document and standardize the development process by making collaboration easier, making local backups borderline unnecessary, and <strong>leaving a trail of communication attached to changes in a code base logged over time.</strong></p><p>Installation and setup of this tool ought not to be explained by me. Visit Github’s instructions on <a href="https://docs.github.com/en/get-started/quickstart/set-up-git">setting up git</a> to download and install the tool. I am going to talk about using Git/Github through the command line because that’s how I learned it and use it in my day-to-day, but the nice thing is that the core concepts are basically universal.</p><h3>The General Process</h3><p>Starting from a repository that you have control over (you can <a href="https://docs.github.com/en/get-started/quickstart/fork-a-repo">fork</a> a repo or make your own), the step-by-step workflow for making changes to a project is as follows. This is the thousand foot view, so scroll down if you just want to know the commands to type ;)</p><h4>Make sure your repository is up to date.</h4><p>The local file you have representing your repository could be different than the most recent changes on the primary branch of the project. Make sure you’re on the main branch and have all the latest updates.</p><h4>Checkout a new branch.</h4><p>To ‘checkout a branch’ is simply to make your own version of the project that you can make changes to, break without repercussion, and eventually bring back to your collaborators to show off the shiny new feature you’ve implemented. By checking out a new branch, you’ve opened a conversation around a topic, like a new feature implementation, a bug fix, or an edit to the documentation. This conversation can and should be continued until it’s time to decide whether your changes ought to end up on the main branch.</p><h4>Add / Commit as you see fit.</h4><p>The amount of work that corresponds to a branch is something that your team (or, more likely, your boss/teacher/company) decides. It depends on the project, skill levels, and design philosophy. No matter what, though, keep this in mind: when you commit changes to your branch, your team will be able to see them and (if you ask) give feedback. So DON’T write bad commit messages. It’s important to clearly lay our your plans for your ideas, or at the least effectively communicate what you’re going for. Good programmers write good programs. Great programmers are the glue between code, the written explanation of what code does, and who is supposed to use the code.</p><h4>Once you’re happy with how it’s working, submit a pull request.</h4><p>So, you’ve added and committed to your heart’s content, and you want some feedback from your team. Now it’s time to create something called a ‘pull request’ (PR). Essentially, this is you asking the team / project owner to take on the changes you’ve made in your branch. There’s a few things to consider here. Firstly, we have the technical: if your changes can’t be seamlessly merged into the most updated version on the primary branch of the project, Github will make this very clear to you. Note that this is NOT a bad thing. It might just need some more attention. There are awesome guides on <a href="https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-on-github">resolving merge conflicts</a> from so many sources, and it’s way, WAY out of the scope of this article. My advice is to be patient and thorough. You can do it! You will probably also have to. Beyond the merge-ability, though, you should consider the text field of the PR. You owe it to your collaborators to clearly and concisely make the case for these changes. If you are on a small development team, this can slide easily, but I do believe it’s vital to keeping a record of what has happened to the codebase and why. Note that you can make as many commits to your branch as you want before making a pull request, and you might have to make a few more after talking to your team.</p><h4>Review the pull request together and test it.</h4><p>Github has a full-featured interface for leaving comments on PRs and even individual sections of code. Use these features as much as you can, you’ll learn from your team and independently. Another option is to talk about changes face-to-face (or perhaps, screen-to-screen). Other collaborators can easily pull down your branch and test it on their own systems.</p><h4>Merge and move on!</h4><p>Once everybody’s happy with the pull request, merge it onto your main branch (I prefer to stick to the website GUI for this). Get yourself a beverage to celebrate your newfound Github workflow prowess.</p><h3>(Most of ) The commands I use and what they do</h3><p><strong>Clone:</strong></p><pre>git clone [repository_url]</pre><p>Cloning a repository is how you bring it onto your machine to run the project, look through it in your text editor, or make changes to it. You can clone any public repository you can find, and any private repository your Github account has been labeled as a ‘contributor’ under.</p><p><strong>Pull:</strong></p><pre>git pull </pre><p>The pull command brings changes from a remote repository into the branch you’re currently working on. You’ll find yourself often using ‘git pull origin main’, for example, to sync up your project with the most recent changes to the main branch.</p><p><strong>Add:</strong></p><pre>git add [filename]</pre><p>The add command marks a file that you have changed locally as something you want to be included in your next commit. This is sometimes referred to as being ‘staged’, but really means you’ve marked it as something you’re done changing for now.</p><p><strong>Commit:</strong></p><pre>git commit -m ‘message here’</pre><p>The commit command confirms and published changed files you’ve added, and contains a helpful message about what has been changed. These can help you write a PR later on down the line, so be descriptive and succinct.</p><p><strong>Checkout</strong>:</p><pre>git checkout -b [new_branch]</pre><p>Given the -b flag, this makes a new branch called [new_branch]. Often times I like to do the format of my username and the thing I’m doing. As an example: benjiaa/fix_popularity_bug</p><p>Without the -b, this command switches to an existing branch of the specified name.</p><p><strong>Fetch:</strong></p><pre>git fetch origin</pre><p>This can be used to update existing branches. The command above pulls down all the changes to branches your local repository can’t see, so use it before you want to see your collaborator’s changes to the project.</p><p><strong>Status:</strong></p><pre>git status</pre><p>Displays what’s been added or changed since the last commit, as well a what branch you’re currently on. Status is a great way to figure out exactly what the hell is going on.</p><p><strong>Stash:</strong></p><pre>git stash<br>git stash pop<br>git stash drop</pre><p>If you want to keep your changes locally, but don’t want to commit them yet, you can use git stash / git stash pop to push changes onto or off of your stack. If you want to completely remove what’s on your stack, just do a git stash drop. Use these in conjunction with status to check what changes are ready to be committed.</p><h3>Why?</h3><p>By this point, you might be seriously considering just going back to emailing your python scripts back and forth with your CS groupmates. While you have every right to do that, consider this:</p><p><strong>If not now, when?</strong></p><p>The best time to start doing things right was yesterday, but the second best time to start is today. At some point, you will have wished everything was in a git repository. Maybe not now, but when you’re trying to share your work, transfer project ownership, or just keep everything in one place, you’ll wish that you’d have set up a git repo.</p><p><strong>History.</strong></p><p>When you and your team commit to making changes with online SCM software, you being to develop a history of everything that’s ever happened to that source code. This is nice because people quit, stop, or die pretty often. At some point, someone will be interested in the story of this source code. Do them a favor by writing one passively.</p><p><a href="https://benjiaa.github.io/">Check out out my website!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55bff0e9123a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>