Intro to Git

22 Jan 2020

Today I took my deepest dive yet into Git and by the end of the day achieved a bunch of firsts working from the command line, including initializing a repo from existing code on my local machine and cloning a remote repo.

The main resources I used were:

(Before even getting started I ran into an issue, as attempting to run Git resulted in an error like “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at /Library/Developer/CommandLineTools/usr/bin/xcrun.” It turned out that this problem was related to my recent update to macOS Catalina, and I needed to update Xcode Command-line Tools with xcode-select --install. The Stack Overflow post I found describing the problem and solution(s) is here.(I may need to consult this in the future, as it sounds like this issue pops up after every macOS update.)

Anyway, prior to today I’d had seen a demo of Git from the command line and listened to one podcast about it, but hadn’t used it myself. I had set up a Git Hub account, set up, forked and modified repos using the web interface.

Key achievements of the day

Next steps

Notes from today

Working locally

Reversing changes

Initialize respository from existing code

Working on remote repo

Viewing info about remote repo

Get changes from a remote repository

Fetch & merge in one command

Upload changes to remote

Pushing changes to remote branch - workflow

Merge a branch

Deleting a branch

Create a feature branch

Push branch to remote repo