Skip to content

First change to synthmodes walkthrough

boourns edited this page Mar 19, 2021 · 1 revision

So you want to make a change to Synth Modes but you've never used git before. This guide will walk you through basic git command line usage.

Before we begin

Sign up to Github and follow their Generating a new SSH key guide.

If you don't have git installed, you will need to install it.

When you're ready to begin, also read https://guides.github.com/introduction/flow/

Fork the project

If you aren't a contributor to the project, you need to make your own fork. This is your own copy of the github repository. If you wanted to, you could proceed to change the Synth Modes repo to your liking and never merge your changes back to the original copy (but I hope you do!).

If you are a contributor to the project, you will be able to push branches directly to the main project and do not need your own fork.

So, if you are not a contributor, go to github.com/boourns/synthmodes and press the Fork button.

Clone the project to your computer

In a terminal session on your computer, run git clone [email protected]:boourns/synthmodes.git.

If you also made your own fork of the repository, add that as a second remote: git remote add my_copy [email protected]:myUserName/synthmodes.git

You are now ready to begin your first contribution.

Pull latest changes

Run the following commands:

git checkout master - if you were working on a different branch, you're now back on master

git pull origin master - pull any changes that have happened to the github copy of the repository since the last time you pulled changes.

git status - should report On branch master. Your branch is up to date with 'origin/master'.

Create a new branch

A branch is where you'll do your work.

git checkout -b my_branch_name. Name your branch based on what you're doing, like "update_disting" or "add_pico_whatever".

Now your local copy of the repository is checked out on my_branch_name. When you do commits, they'll be on my_branch_name and not on master. This is good, because we do our work on a branch, and then open a pull request, and when the pull request is merged it will merge onto master.

Make your changes

Add files, edit files, etc.

Whenever you've completed some work you don't want to lose, commit the changes.

git commit -a will commit all changes, or you can use git add (files you want to commit) followed by git commit. You need to add a descriptive message.

If you want to see what changes will be committed, you can see a summary with git summary or see the code changes with git diff.

If you want to undo changes you've made to a file but have not committed, you can run git checkout path/to/file to check the committed version of a file out. This will overwrite any unsaved changes you had made to the file.

Push your branch to github

If you are a contributor to the project, you can push directly to origin with git push origin my_branch_name. Then browse to the github repository and open a pull request and tag me @boourns in the pull request description.

If you are not a contributor, you need to push to your own remote copy, and then open a pull request against the main repository from there. So you would run git push my_copy my_branch_name.

Open your pull request

From there we'll make any necessary changes and get it merged!