Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

How to use Git and GitHub on your Mac

Lucy Hattersley | July 6, 2016
Git and GitHub enable modern programmers to work collaboratively and keep track of different versions of their software.

Alongside the most popular languages, like Python and Java, sits Git as one of the essential tools a modern programmer needs.

Git, and its popular web-based companion GitHub are versioning tools. Used by developers to track different versions of the software they (and others) build. Git was designed in 2005 by the Linux Kernel team for Linux development, but it's since spread to all the key developers and all languages. Apple uses Git to track changes to its Swift development project, for example

Git doesn't stand for anything; it mostly takes its name from the British slang word and the official GIT - README documentation refers to it as "GIT - the stupid content tracker."

Learn to use Git and GitHub: What is Git and GitHub?

Learn Git on Mac

With Git, you track different versions of your code, which makes it possible to try out new ideas while keeping your original code safe. If the new code works, it can be merged into your current code, or discarded. Git is mostly used by code, but it can be used to track changes to text documents, and is also used

Perhaps more importantly, Git enables multiple people to work on code together. Changes can be made by individuals, and pushed to check. If the change is accepted, it can implemented by the main body of code. Git makes it much easier for people to work collaboratively on projects.

GitHub meanwhile is a website and hosting service. It uses the Git commands (and a few extra of its own) to store your code, and revisions, online. You use Git to push your code to GitHub, and it is stored (and shared) online in a space known as a "repository". You use GitHub to find code and projects by other developers, and can examine the code, follow projects and clone them to your local machine (and even contribute to projects).

GitHub is pretty popular, with 14 million developers using it and over 35 million repositories.

How to set up Git on your Mac

Install Git on Mac

To fully learn Git, you'll need to set up both Git and GitHub on your Mac. Both are long you've been programming, and what tools you've installed, you may already have Git on your computer.

Open Terminal and enter git --version. If you see git version followed by numbers, i.e., git 2.5.4 then you are good to go. If you don't have Git installed, then an alert will appear displaying "The "git" command requires the command line developer tools. Would you like to install the tools now?"

 

1  2  Next Page 

Sign up for CIO Asia eNewsletters.