git notes #########
.. contents::
.. 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”
if this is your first commit/push:
.. code-block:: bash
git push origin master
else:
.. code-block:: bash
git push
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
create a remote fork on github
press the fork button when logged in
clone the remote fork to your local host
.. code-block:: bash
cd ~/git git clone https://github.com/russellballestrini/salt.git cd salt
make some changes to source code and push to remote origin (your github fork)
.. code-block:: bash
git add . git commit git push
perform a pull-request using github gui
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.
Tell your local repo about the upstream repo
.. code-block:: bash
git remote add upstream https://github.com/saltstack/salt.git git fetch upstream
view all branches
.. code-block:: bash
git branch -a
sync local with remote upstream
.. code-block:: bash
git pull upstream develop
push local to remote origin
.. code-block:: bash
git push origin
.. code-block:: bash
git config –global core.editor “vim”
.. code-block:: bash
git config –global color.ui true