Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Import Link Fixer

For details on the branch structure see:  Branch Structure

Installation

Download the latest git-scm installer from: https://git-scm.com/downloads and install on your system (current verified version is 2.24.0).

When installing git-scm select the defaults below are what those options look like. (note: on the default editor for git can be any text editor of your choice).

Image Added   Image Added

Image Added   Image Added

Image Added

Download the following zip: sg-install.zip

...

Open a git bash prompt and change directory to the selected folder. Note git bash is a linux like command prompt

Setup

sg is simply a wrapper around git. Its primary goal is to replicate git commands to multiple folders / repositories within a given parent folder.

...

Opening a git bash prompt, navigating to the directory in which sg is installed and typing the command "sg clone" will then download a local copy of the Source repositories.


Terminology 

  • Commit: stores the current contents of the index in a new commit along with a log message from the user describing the changes
  • Branch: a pointer to a commit

  • Master: the default name for the first branch

  • HEAD: a pointer to the most recent commit on the current branch

  • Merge: joining two or more commit histories

  • Workspace: the colloquial name for your local copy of a Git repository

  • Working tree: the current branch in your workspace; you see this in git status output all the time

  • Cache: a space intended to temporarily store uncommitted changes

  • Index: the cache where changes are stored before they are committed

  • Tracked and untracked files: files either in the index cache or not yet added to it

  • Stash: another cache, that acts as a stack, where changes can be stored without committing them

  • Origin: the default name for a remote repository

  • Local repository: another term for where you keep your copy of a Git repository on your workstation

  • Remote repository: a secondary copy of a Git repository where you push changes for collaboration or backup

  • Upstream repository: the colloquial term for a remote repository that you track

  • Pull request: a GitHub-specific term to let others know about changes you've pushed to a branch in a repository

  • Merge request: a GitLab-specific term to let others know about changes you've pushed to a branch in a repository

  • 'origin/master': the default setting for a remote repository and its primary branch

Typical Tasks and Commands

Info

All commands listed below are performed on all repositories contained in the folder. If you wish to perform the commands only on one repository simply change directory to that repository and use git commands directory instead.

Fetch the specified remote’s copy of current branch and immediately
merge it into the local copy
TaskCommandDescription
Get initial local copy of all codesg cloneUsed only to get the initial local copy of the Source repositories
Get latest changes for a specific branchsg fetch origin <branch>Fetches a specific <branch>, from the repo. Leave off <branch> to fetch all remote refs.
Make your local copy switch to a branchsg checkout <branch>

Check out branch named <branch>. There are a few different cases

  • You've never checked out <branch> locally but it does exist on the remote: this will give the latest version you've fetched.
  • You've previously checked out <branch>: your local copy switches to the same version of <branch> that you previously had. It will not pull in the latest version even if you've fetched it. Use git pull to update.
  • You want to create a new branch from your current commit: Add a -b flag
Add all changes made to a commitsg add <directory>Stage all changes in <directory> for the next commit. Replace <directory> with a <file> to change a specific file. Also . can be used to specify all including all changes.
Commit changes to your local copysg commit -m "<message>"Commit the staged snapshot, but instead of launching a text editor, use as the commit message.sg branchList all of the branches in your repos.sg checkout -b <branch>Create and check out a new branch named <branch>. Drop the -b flag to checkout an existing branch.git merge <branch>Merge into the current branch.git fetch <remote> <branch>Fetches a specific <branch>, from the repo. Leave off <branch> to fetch all remote refs.git push --all origingit pull <remote>
Push changes to server for everyone else to getgit push origin <branch>Push the branch to remote server, along with necessary commits and objects. Creates named branch in the remote repo if it doesn’t exist. Drop <branch> and add --all to do all branches. 
See what branches are available on repositoriessg branchList all of the branches in all repos.