% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{iftex}
\ifPDFTeX
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
  \usepackage{unicode-math} % this also loads fontspec
  \defaultfontfeatures{Scale=MatchLowercase}
  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
\usepackage{lmodern}
\ifPDFTeX\else
  % xetex/luatex font selection
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
  \usepackage[]{microtype}
  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
  \IfFileExists{parskip.sty}{%
    \usepackage{parskip}
  }{% else
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
  \KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\ifLuaTeX
  \usepackage{selnolig}  % disable illegal ligatures
\fi
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same}
\hypersetup{
  pdftitle={git},
  hidelinks,
  pdfcreator={LaTeX via pandoc}}

\title{git}
\author{}
\date{}

\begin{document}
\maketitle

\hypertarget{git}{%
\section{git}\label{git}}

git notes \#\#\#\#\#\#\#\#\#

.. contents::

\hypertarget{set-a-local-repo-or-global-username}{%
\section{Set a local repo or global
username}\label{set-a-local-repo-or-global-username}}

.. code-block:: bash

git config --local user.name ``fox'' git config --local user.email
``fox@localhost''

git config --global user.name ``foxhop'' git config --global user.email
``foxhop@foxhop.net''

\hypertarget{how-to-push-to-remote-master}{%
\section{How to push to remote
master}\label{how-to-push-to-remote-master}}

if this is your first commit/push:

.. code-block:: bash

git push origin master

else:

.. code-block:: bash

git push

\hypertarget{basic-github-workflow}{%
\section{Basic github workflow}\label{basic-github-workflow}}

upstream original remote github repo, read-only

only way to change this repo is to ask for a merge using a pull-request

origin forked remote github repo, read-write

push you changes here and perform pull requests

local cloned local, read-write

make changes and push to origin

pull changes from upstream, perform merges and fast forwards to keep
sync'd

\hypertarget{example-using-salt-repo}{%
\subsection{example using salt repo}\label{example-using-salt-repo}}

\begin{enumerate}
\item
  create a remote fork on github

  press the fork button when logged in
\item
  clone the remote fork to your local host

  .. code-block:: bash

  cd \textasciitilde/git git clone
  https://github.com/russellballestrini/salt.git cd salt
\item
  make some changes to source code and push to remote origin (your
  github fork)

  .. code-block:: bash

  git add . git commit git push
\item
  perform a pull-request using github gui
\end{enumerate}

Go on vacation for 1 week Your local and origin repos now appear
out-of-date. Sync them by performing a fast-forward or merge with
upstream.

\begin{enumerate}
\item
  Tell your local repo about the upstream repo

  .. code-block:: bash

  git remote add upstream https://github.com/saltstack/salt.git git
  fetch upstream
\item
  view all branches

  .. code-block:: bash

  git branch -a

  \begin{itemize}
  \tightlist
  \item
    develop remotes/origin/0.11 remotes/origin/0.12 remotes/origin/0.13
    remotes/origin/HEAD -\textgreater{} origin/develop
    remotes/origin/develop remotes/origin/master remotes/origin/no\_ipv6
    remotes/upstream/0.11 remotes/upstream/0.12 remotes/upstream/0.13
    remotes/upstream/develop remotes/upstream/master
    remotes/upstream/no\_ipv6
  \end{itemize}
\item
  sync local with remote upstream

  .. code-block:: bash

  git pull upstream develop
\item
  push local to remote origin

  .. code-block:: bash

  git push origin
\end{enumerate}

\hypertarget{how-to-set-the-git-commit-editor}{%
\section{how to set the git commit
editor}\label{how-to-set-the-git-commit-editor}}

.. code-block:: bash

git config --global core.editor ``vim''

\hypertarget{how-to-enable-colorful-ui-and-diffs}{%
\section{how to enable colorful ui and
diffs}\label{how-to-enable-colorful-ui-and-diffs}}

.. code-block:: bash

git config --global color.ui true

\end{document}
