Week 6

Summary - John's Notes

Commands

  • git stash - Short for git stash save, creates a stash of local modifications
  • git stash apply <stash_name> - Applies a stash back onto a branch
  • git stash drop <stash_name> - Remove a stash from the stash list
  • git stash list - Show a list of current stashes
  • git stash show <stash_name> - Show information about a specific stash
  • git stash show <stash_name> -p - Show the contents of a stash
  • git clone <local> <remote> - Clone a Git repository, from the local to the remote location.
  • git branch -r - Show all remote branch references
  • git remote - Show a list of remote repositories
  • git remote -v - Show a more detailed list of remote repositories
  • git diff <branch> <remote>/<branch> -- <file> - Show the differences between the two branches, one local, one remote, for a particular file.
  • git remote show <remote> - Show detailed information about tracked branches for the specified remote repository
  • git log <remote>/<branch> -- <file> - Show the log of the remote branch specified for a particular file
  • git checkout <remote>/<branch> - Checkout a remote branch, leaving the local working tree in a detached HEAD state
  • git checkout -b <branch> <remote>/<branch> - Create and switch to a new branch, which is set up to track a remote branch specified
  • git fetch <remote> - Fetch updates to the remote branch specified including all objects and branches
  • git pull - When configured, fetches and merges a remote branch into the currently checked out branch.
  • git clone <local> <remote> --bare - Creates a bare repository, suitable for pushing into
  • git push - When configured, pushes all changes up to the configured remote branch
  • git push <remote> <local_brch>:<remote_brch> - Pushes a local branch to a remote location with a different name

Terminology

  • Stash - A temporary storage of local modifications that can be brought back onto the branch at a later date
  • Remote - A copy of a repository, or part of a repository in a remote location
  • Pull - Merging changes from a remote branch into a current local one
  • Push - Pushing changes from a local branch into a remote one
  • Fetch - Pull into the local repository, all new objects and update all branch HEADs to point to the same commits as the remote location

Previous Day

Next Day

 
   
home | download | read now | source | feedback | legal stuff