Week 7: Version Control
- danielclarke1981
- Mar 13, 2022
- 5 min read
Updated: Mar 16, 2022
Week 7 and we were asked to look at and discuss version control, along with setting up a repository on Github.
So what is version control and how does it relate to Git and Github? In essence version control systems records changes to files and directories creating a history that can you can revisit and revert to. Git is the latest in a long history of these systems and is the most popular at the time of writing this. Git is a distributed version control system (DVCS), meaning in its purest form there is not one single master repository forr the files you are versioning. Git was created by Linus Torvalds in 2005 - who is also responsible for the Linux kernel - as a response to the lack of a decent, nonproprietary, version control system on the market.
GitHub is a central repository for Git projects, similar to Git Lab or Bit Bucket. Central repositories are a repo's origin, so adding GitHub in the mix means it isn't truly following the distributed paradigm. Understanding that Git and GitHub aren't the same things can throw people sometimes, myself included, There is of course a lot of confusion with some of the terminology regarding Git and GitHub, with some of the latter becoming synonymous with the former like forking and pull requests, which aren't actually Git constructs,
People often confuse Git and GitHub, but they are quite different things. GitHub provides services that are related to Git. It’s a website that helps you manage Git-controlled projects.
(Daityari, 2015)
GitHub also allows for teams to review and QA each other's code, and public repositories are great places for opens source projects that people can fork and experiment on.
Before I used Git, I was predominantly a solo developer. Versioning would have been useful at this stage in my career but I didn't see it as a burning priority. At the time I could get away with prepending a v-1 or a date on the end of a file and call it good. However, that all changed 2 years ago when I joined a development team and I had to get up to speed with Git and GitHub pretty quickly. I remember struggling with the concepts initially, and I started to resent the fact I had neglected to pick up this core development skill earlier in my career. In light of my enrolling on this MA, that notion now seems somewhat absurd, but at the time I was genuinely concerned I self-sabotaged my career. Branching, Merge conflicts and the dreaded rebase all used to cause me to break out in a cold sweat (Rebasing still does to this day). I remember feeling the tools were more of a hindrance than a help, but everyone assured me to stick with it and once I acquired a working understanding of the principles, I began to see the benefits. I now consider it an essential tool in my job as a Front End Developer and I couldn't imagine not using it now. I am able to rewind the clock on commits and it helped me debug errors and find origins of issues, especially with extensions like GitLens for my IDE. It also gives me the confidence to take risks and explore experimental features we may be thinking of implementing without fear of breaking what we know already works. I can simply branch off master and my work is siloed until it is approved and merged in. Finally, it has helped me become a better collaborative developer, which became even more important when the team was forced to work remotely due to the Covid pandemic. In this regard, Git, and Github helped us navigate troubling times with minimal disruption. The distributed nature meant we could work on features separately at home but GitHub meant we have a central point to push code and review.
One thing I have not used before is GitHub Desktop, as I find it quicker and easier to use the command line built into my IDE. The projects I work on at work are Laravel and Javascript-based so this makes sense using it this way. However, If I do decide to start experimenting with Unity or other games development platforms may very well use GitHub Desktop as Giovanni demonstrated as I can see it as a natural choice in this instance. In any case, I've set up my test repository as recommended and have downloaded the desktop app.
As I started thinking about how I could use version control for the module, I struggled to see how I could use it for UX prototyping; especially for physical products or paper prototypes. I appreciate how it could be used for specific proof of concept that required coding in Unity or HTML5/Javascript (similar to my Augmented reality experiment in week 3) but most cases do not require coding, unlike my indie game counterparts. I also began to wonder how I could use a DVCS with tools such as Figma or Adobe XD. Researching this a little further I found that Figma does in fact has its own version history feature which adds checkpoints every 30 minutes of inactivity. This will definitely need exploring further, as I was literally saving multiple files in a similar vein to my previous dev workflow before discovering Git. However, it looks like there are a few caveats when using it:
- Supported on any team or plan. Members of Starter teams can only view 30 days of a file's version history. Members of Professional and Education team or Figma Organizations can access a file's entire version history. Upgrade the team to access unlimited version history. - Anyone with Can view access to the file can view and browse the file's version history. - Only people with Can edit access to the file can create, name, remove, or restore a file's version history.
(View a file's version history, 2022)
My current use of Figma has been local using the desktop version so I haven't even explored its online or collaborative features and after reading it looks like this is one of those features. I'll need to investigate if my account has the privileges to allow this. This look like a perfect time to set a SMART goal:
To research if I am able to use Figma's Version History feature using my current account setting and if not see if there is an opportunity to upgrade my profile. I will look at doing this within the next 7 days.
References
https://help.figma.com/. 2022. View a file's version history. [online] Available at: <https://help.figma.com/hc/en-us/articles/360038006754-View-a-file-s-version-history> [Accessed 7 March 2022].
Kinsta®. 2022. Git vs Github: What's the Difference and How to Get Started with Both. [online] Available at: <https://kinsta.com/knowledgebase/git-vs-github/> [Accessed 7 March 2022].
Chacon, S. and Straub, B., 2014. Pro Git. 2nd ed. Berkeley, CA: Apress.
Daityari, S., 2015. Jump Start Git. 1st ed. SitePoint Pty. Ltd, p.31.
NicePNG, 2022. Github Branching Workflow Diagram - Git Flow. [image] Available at: <https://www.nicepng.com/ourpic/u2y3q8q8u2t4a9r5_github-branching-workflow-diagram-git-flow/> [Accessed 7 March 2022].
Comments