To my programming students, below are the instructions for getting the code we’ve been going over as well as how to create and publish a branch as well as how to sync it to the server. You’re objective for the next week is to remove the code related to square and create a spinning cube with each side a different color. I wish you luck!
Log in to the GitLab server and from the main screen go to the projects tab on the left hand side.
You’ll see a project name similar to below.
On the next screen, click on HTTP and leave this window open!
Now… Open up Visual Studio. Make sure you have a Microsoft Account setup so that the 30 day trial doesn’t complain. If your parents have an account, ask them to use theirs, if not, make a “fake” account for the purposes of using Visual Studio.
Now inside Visual Studio, you’ll need to open up the Team Viewer if it’s not already open (look to the right of the screen, tabs at the bottom of the screen). If not open, you can find it here.
Inside of the Team Explorer, we’ll start under the Connect Tab.
From here, it’ll be the same for every repository of code you’ll be downloading or starting fresh. We’ll need to clone a copy of the code so that you can work with it locally on your machine.
You’ll need the HTTP address from above here. You’ll paste that into the box (probably yellow when empty) and it’ll pick a place to save the copy. Hit clone and it’ll ask for your username and password from the GitLab server. If asked to save, do so so that you won’t have to type it in every time you need to work with the server.
Once cloned, it’ll appear underneath as shown above. You’ll need to double click on the repo name to open it up. It’ll lead to the following screen.
This is the “Home” screen (Home icon up top). We’ll be doing a few things here. Anytime I mention “working from Home,” this is where I’m talking about.
Next we need to create a branch for you to work on. Click on branches, click on “new branch”, give it the name as shown replacing the rh at the beginning with your first and last initials. Make sure the drop down shows “master” and the “Checkout branch” checkmark is checked. Then click “Create Branch”.
This branch is what you’ll be working with for the changes. But before you make any changes, we need to make sure a copy can be sent to the server. Next we’re going to “Publish” this branch. Right click on the new branch and click on “Publish Branch.”
It shouldn’t ask you for your username/password again, but if it does, just enter the same info as you would for the GitLab server.
The only code you’ll need to modify is in 1 section of the code. Under the Solution Explorer (look at the bottom tabs where it says “Team Explorer” or under the view menu), under the Source Files, the DisplayManager.cpp file. Scroll down tot he DisplayManager::drawScene() method.
You won’t need the code related to GL_QUARDS so go ahead and remove it and everything associated with the square.
Once you’ve made changes, you’ll need to “commit” and “sync” them. From the Home screen, go under “Changes”.
You’ll need to give it a message to say what you did, for example, “Removed Quads” are all the changes I made when I removed all code associated with…. removing the code related to the GL_QUADS. Once you press “Commit,” the changes will be staged and ready to be synced to the server, but they won’t be yet.
When committing changes, it may ask to confirm that you really want to commit them. Go ahead and say yes.
The nice thing about how this works is you can do a lot of small changes, say one commit for each side of the cube for example, and then sync them all at once later when you’re ready.
When you’re ready to sync to the server, go back to the Home screen in the Team Explorer and click on the “Unsynced Commits” button. From here you’ll see a list of commits that haven’t been sent to the server. Just click the “Sync” button and let it go. It’ll send all the changes up.
Every project we work on from here on out, this is how we’ll keep up on what changes are being done.
As always, if you need help with this, send me an email. I’ll respond as fast as I’m able.
* UPDATE: On first commit, it may ask to setup Username and Email address. Please set this up as it is needed for accountability of changes and is recorded in the code repository. It’s sort of change tracking while working with teams. It lets us confirm who did what.