In fact IT IS a code project … If you open any .vcv file with a text editor (notepad (win), textedit (mac)) you’ll see that it is a code file that includes all the info about all the modules and its parameters + other info in the patch (i think its a .json file)
So let’s staaaaaart! … Hey guuuuuuuuuuyssssssss! (and gals)
NORMAL GIT PROCESS WITH VCV RACK
So the normal git process to use it with VCV Rack is:
- Create a working directory for your patch and go there with the command line terminal or GUI
- Create a local repo using
git init
in the terminal - Start a new patch in VCV Rack and save it in your working directory
- Use
git status
command to check that git has knowledge of the new file - Add the new file to the staging (intermediate) area using
git add <filename.vcv>
- Use
git status
to check that git already has some file to commit to the repo - Use
git commit -m <"useful_msg">
(ex.:git commit -m "Initial Patch"
) to commit the file to the repo - Use
git log
to check the commits
So you have already your initial patch in the git repo of your working directory.
USING ONLY THE MASTER BRANCH FOR THE PROJECT (PATCH)
Now if you want to work all the time with the same file (i.e.: no separate versions) you continue (1) working with your patch, (2) save it from time to time, (3) use steps 5. and 7. above (with appropiate msg to each commit) to commit your file to the repo, work again in it, and so on until you finish your project. And if for some reason you want to revert to some previous commit (kind of version):
- Use
git log
to see the list of all your commits and its asociated commit_number (the long line of numbers and letters right to the word ‘commit’) - Copy the commit_number of the commit you want to go back to, and use
git checkout <commit_number>
Now if you reload your patch you’ll see that the patch is in the state you save it in that commit … And if you use git log
you’ll see that any later commits have dissapeared … BUT DON’T WORRY, because they are still there in the repo … So to go back to your latest commit use git checkout master
(use git log
to check that it is so) … So if you now reload the patch you’ll see that it is the last commit you made (i.e.: the last “version”).
USING NEW BRANCHES FOR CHECKING NEW THINGS/MODULES
Now let’s say that you want to keep your initial patch as it is, but want to check some new things, or new modules without “corrupting” the actual patch … Then you’ll need to create a new branch:
- Use
git brach <branch_name>
(ex.:git branch test
) to create a new branch - Use
git branch
to check that the new branch has been created
After that you have an exact copy of the master branch in the new branch
- Use
git checkout <branch_name>
to go to the new branch
Now you are in the new branch and any changes you do to the patch will effect only this branch … BUT NOTE that it seems that nothing has changed in the working folder: i.e.: the initial file is there and no sign of new folders with a .vcv file in it … WHAT’S HAPPENING?!
Don’t worry and do this:
- Make some changes to the patch and save it (again no changes in the working directory - the same file and no new folders)
- Use
git add <filename.vcv>
followed by agit commit -m <"useful_msg">
to commit the file to the repo - Use the New File command in VCV Rack to clear the current patch
- Load the file in the working folder … you’ll see that it is the same patch you just saved … No problem!
Now do this:
- Use
git checkout master
to return to the master branch - Use
git branch
to be sure you are in the master branch (there will be an asterisk beside the name) - Again use the New File command in VCV Rack to clear the current patch
- Load the file in the working folder AND … TACHAAAAN!! … The GIT MIRACLE!!!
BUT THERE’S STILL MORE, SO DON’T LEAVE YET
Let’s say that you’re satisfied with the changes you’ve made in your new branch and you want them to be added to the patch in the master branch (let’s assume that the new branch is called “test”):
- Use
git branch
to be sure that you’re in the master branch, if not usegit checkout master
to go there - Use
git merge test
to merge the changes you’ve made in the test branch with the patch in the master branch - Clear the patch and load the file in the working folder … TACHAAAAAAN!!! … More Git Miracles!!!
NOTE: Don’t forget that you can always go back in commit history with git checkout <commit_number>
… And keep in mind that any branch you’ve created will be there until you remove it with git -D <branch_name>
Isn’t Git wonderfull?!!
So THANKS A LOT @dirkleas for introducing Git to the VCV Rack Realm!!
Hope this can be of help to someone
P.S.: Next Chapter: Automating the Process!