This GitHub repository contains files used by and explained in Wilson Mar's Git and GitHub course.
There are two editions of scripts in this repo:
-
File names ending in .sh are Bash shell scripts that normally run on Mac, and now also on Windows machines installed with Microsoft's WSL (Windows Subystem for Linux).
-
File names ending in .ps1 are PowerShell scripts that run on Windows, but now also Mac and Linux machines after installing Microsoft's PowerShell on OSX.
-
File names ending in .py are Python scripts that normally run on Mac, and now also on Windows machines installed with Microsoft's WSL (Windows Subystem for Linux).
Such scripts are being phased out in favor of cross-platform Python script for use on all platforms. However, Python first needs to be installed.
mac-git-install.sh automatically installs and configures all you need to work with git and GitHub professionally. It downloads and installs Apple's Xcode, Homebrew, Bash code completion, GPG to enable code signing. Text editors Sublime Text, MacVim, and Microsoft's Code are installed. Git clients GitHub Desktop, GitKraken, or SmartGit are installed. These are installed based a setting in file .secrets.sh.
Begin by changing that file with your own information. That data is used to create SSH keys and config files. The script stops if the secrets file still contain default account info. The .gitignore file keeps local customizations (password) from being uploaded to GitHub.
If a component has already been installed, the "UPGRADE" parameter added when executing the script results in an upgrade to the latest version of each component.
The script also configures .bash_profile by adding in contents of the mac-bash-profile.txt file containing keyboard aliases. It configures your .gitconfig with color.ui and code signing after it generates GPG and SSH keys for pasting into GitHub or other repositories. Version numbers are output for each utility installed. If something is already installed, that is skipped. So this script can be run again.
git-hooks-install.ps1 should be run after cloning locally to install scripts that Git invokes automatically based on events. A git clone is necessary to re-build the database. git-sisters-update.ps1 is a PowerShell script that clones a sample sample repository you forked on GitHub. It calls a script that sets git configurations for a project (or globally)git_client-config.ps1 git-sample-repo-create.ps1 is a PowerShell script that creates a repository on your local clones your fork of a sample sample repository.
TODO: A script that provides a summary report of where there are un-pushed files lingering among a set of repo folders locally (folders with a .git folder).
All these scripts create a folder, but that folder is deleted at the beginning of each run to make them "idempotent" in that each run of the script ends up in the same condition, whether run the first time or subsequent times.
The scripts contain an exit after each set of steps so you can examine the impact of the whole sequence of commands.
Additionally, diagrams (animated step-by-step in PowerPoint) have been prepared to illustrate the flow and sequence of commands.
Enjoy!
(Changed for class)