Blog‎ > ‎

An interesting (to me) version control scenario

posted Apr 27, 2014, 8:20 AM by Lewis Baumstark
I'm thinking about toying with the idea of maybe doing some hacking on the Arduino IDE.  So I made a local clone of their public Git repository:

git clone git://github.com/arduino/Arduino.git

So far it's pretty basic stuff; from here I can hack on the codebase, commit my own changes, etc.  Importantly, I can keep my local copy of the codebase up-to-date with changes from the official site via a

git pull

as the official site is listed in my config as the origin remote site.  What I can't do is push my changes (via a get push)  to the official site since I don't have write privileges there (and for good reason!)

Since I'm looking at adding new features, I'm going to create (and move to) a new branch (named "windshield" for mysterious reasons) in my local repository:

git checkout -b windshield

Still pretty basic.  From here on, any changes I make will be part of the windshield branch and won't pollute the master branch until I merge them.  This should help with pulling official updates as well.

Now where it gets weird is I want to back up my changes to a different remote repository, one hosted at my workplace (it is, after all, a work-related project).  So first I set a new remote named "uwg" that points to the arduino-windshield project I created at our Gitlab site, and then set the local windshield branch to push its changes to that remote:

git remote add uwg git@code.westga.edu:lewisb/arduino-windshield.git
git branch --set-upstream windshield uwg/windshield

Now, as long as I am working on the windshield branch on my local machine all my commits will go to my work repository when I issue a git push.
Comments