Clone this wiki locally
The Antipasto Arduino IDE is a branch of the standard Arduino IDE release, with a few added features.
Working with Git
While Mark and I were first learning git, we took some notes on how to use git and github. Our goal was to become comfortable using it similar to how someone might use Subversion or other similar tools.
Look at your changes. If you’ve made changes, run this command first. I usually run this often. This command allows you to see the changed files in your tree.
Get the latest changes from the remote server. Pull also does tries to do a merge. It may fail. If so, you should decide if want the changes. If not, git checkout to revert specific files.
See the differences between the your current files and the branch you checked out.
git diff ./somefile/somewhere.txt
You can also git diff a remote branch to have git go out and see how your local files will apply with new remote commits that have been made by other people. Do a diff on your entire repository with the remote origin like this:
git diff remotes/origin/master *
Checkout the original file. This will destroy your current changes and revert the file back to the last committed version. You can also checkout entire directories which is a fast way to reverting back lots of file changes.
git checkout ./somefile/somewhere.txt
Use a GUI interface to help visualize current changes and pick the files for committing. I almost always stage my files to commit through the GUI. It’s especially easier when your first getting comfortable with git or if you just like GUI tools better.
Learn about the world around you. This command shows you all the branches in the project. Projects can have many branches. Some are simply tracking versions, while others point to the remote origin master.
git branch -a
Create a local branch with all your current commits. Use this if you’d like to create branch to move forward of the master. Don’t worry, the master can merge back with you at any time. Before running this, it’s important to make sure you commit (or revert by git checkout) all changes before you branch. Remember, git status is your friend to help you clean up your repository before branching. Usually I git checkout my-branch-name after I create the new branch with git branch.
git branch my-branch-name
Completely checkout an existing branch. All changes to your files might be lost if they are not committed first. It’s good practice to commit before branching and checking out a new branch
git checkout my-branch-name