-
Notifications
You must be signed in to change notification settings - Fork 1
Using Git
Author: Will Richards
Being able to use Git effectively and properly makes development faster by reducing the likelihood of bugs getting through to our production code.
To accomplish this branch protections have been put in place for the main branch and as such doesn't allow direct pushes, code can still be modified through pull requests into main. These require 1 reviewer to approve the push to main.
Most of your version control of Loom code will likely be done through Visual Studio Code's version control UI. Note: If by this point you haven't installed both Visual Studio Code and Git you should do this now
Now that we have Git installed when we open VSCode and navigate to our Loom instance
%localappdata%\Local\Arduino15\packages\loom4\hardware\samd\VERSION\libraries\Loom
We now have an option at the bottom that displays our current branch as well as a circular arrows.
These also change to numbers showing the number of both unpulled changes and unpushed commits.
Moving to the Source Control
tab
From here you can generate commits to push into the selected branch. When you first start using this it will not auto stage changes but if you press commit without staging any it will ask if you want to auto stage. If you want you can also manually stage your changes like so..
From here provide a solid commit message..
And commit the changes!
All that's left to do is push the commits by pressing Sync Changes
You have successfully made and pushed your first commit
To actually modify and push code to create pull request you will need to make a new temporary branch to address the changes. To get started simply click on the current branch in the bottom left corner. It is recommended that bug fixes be branched from main
and more major development work be made from dev
Next give the branch a name and then when you want to publish the branch to create pull request off you click here
That branch is now published to the repository and changes can be committed to as shown above
At some point you will likely want to pull that change into main after through testing has been done. At this point you can create a pull request for your branch.
After clicking New Pull Request
you can select the branch that you would like to pull from and address any merge conflicts and then you can Create the pull request
After giving it a title and any additional information that may be needed to approve it and you can create the pull request