Git Init — Git Crash Course 1
Day 24–11/24/20
Today during our team meeting, Joanne introduced to us the ways that teams use github. It is definitely a little different than how I have been using github when programming individually, but I see the importance of being able to do this properly as a lot of very bad things can happen if you do not know what you are doing while working with a team.
I will share some of the steps I wrote down during the crash course. For our current team git excercise:
Step 1: Locate the repo on Team Leads github.
Step 2: Fork from the Team Lead github, this will create a repo in your own profile.
Step 3: Locate the local folder you would like to create the local repo. In my case this is my Unity Projects folder.
Step 4: When you are in your desired folder, in git bash, type “git clone https://github.com/user/GDHQ-Project.git” This will clone the repo into your folder.
Step 5: If you want to add a gitignore this is the time to do it!
Step 6: Push clone to establish connection with git hub.
Step 7: Create new branch, in this case dev branch. “git checkout -b dev” *dev branch will be used for your latest working version of the program. The main branch will be used as the base version of the program. I believe once all dev changes are approved and the team agrees, the latest dev changes can now be pushed to the main branch and that will become the new base.
Side tangent, I imagine this is how game studios handle beta testing and the actual live game. The main branch would be the live game and the dev branch would be where all testing on future patches are handled. I’m sure they may even go further in-depth just to ensure more backups, to me, I imagine this is how these scenarios are handled.
Step 8: If you have a problem with a script, this is where you could create a new branch so you don’t mess with the working branches, main and dev. Say I need to change something on the player script. I would create a new branch player, “git checkout -b player” I could then make my changes on the player branch and when I am happy with that, I can then merge back onto the dev branch.
Step 9: Merge when happy with changes. Go to your desired branch to merge up to. In this case it would be our dev branch. “git checkout dev” to switch to the dev branch. Now we can merge, make sure you are in the correct branch then merge, “git merge player” This should now merge your player branch into the dev branch and your changes should be playable on your dev branch.
* Very important, do not create branches ahead of the time you need to. At the time of creating a new branch, the current version will be copied over to the new branch. Therefore, if you create a branch at the start of the development, and decide to use it down the road, you will be working with an out of date version.
The Great Fleece
My goal was to finish today, unfortunately, did not quite get there. I ran into a lot of bugginess but managed to get it worked out. When fixing the animations with the sleeping guard cutscene, I needed to extend the final virtual camera to about 2–3 frames. I initially had it at one but, I guess it was too quick to register the camera switch, so when coming out of the cutscene, my camera would not switch to the desired camera. Thank you Ryan for catching this one! The other weird bug I have been dealing with is every so often my main camera will lose its target and start camera position, and I find myself having to re drag and drop the player and start position into the inspector. This isn’t that big of a hassle now but I imagine this could cause a lot of bugginess if someone were to try to play my game.