{"revision": {"id": "f3c14593-2f95-11f1-b6dc-e86a64d24d78", "node_id": "f3bfddd6-2f95-11f1-9b7d-e86a64d24d78", "user_id": "edc3f576-2f95-11f1-900f-e86a64d24d78", "author": "foxhop", "data": "git notes\r\n#########\r\n\r\n.. contents::\r\n\r\n\r\n\r\nSet a local repo or global username\r\n=======================================\r\n\r\n.. code-block:: bash\r\n\r\n git config --local user.name \"fox\"\r\n git config --local user.email \"fox@localhost\" \r\n\r\n git config --global user.name \"foxhop\"\r\n git config --global user.email \"foxhop@foxhop.net\"\r\n\r\nHow to push to remote master\r\n================================\r\n\r\nif this is your first commit/push:\r\n\r\n.. code-block:: bash\r\n\r\n git push origin master\r\n \r\nelse:\r\n\r\n.. code-block:: bash\r\n\r\n git push\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nBasic github workflow\r\n============================\r\n\r\nupstream\r\n original remote github repo, read-only\r\n\r\n only way to change this repo is to ask for a merge using a pull-request\r\n\r\norigin\r\n forked remote github repo, read-write\r\n\r\n push you changes here and perform pull requests \r\n\r\nlocal\r\n cloned local, read-write\r\n\r\n make changes and push to origin \r\n\r\n pull changes from upstream, perform merges and fast forwards to keep sync'd\r\n\r\nexample using salt repo\r\n-------------------------------\r\n\r\n#. create a remote fork on github\r\n\r\n   press the fork button when logged in\r\n\r\n#. clone the remote fork to your local host\r\n\r\n   .. code-block:: bash\r\n\r\n    cd ~/git\r\n    git clone https://github.com/russellballestrini/salt.git\r\n    cd salt\r\n\r\n#. make some changes to source code and push to remote origin (your github fork)\r\n   \r\n   .. code-block:: bash\r\n\r\n    git add .\r\n    git commit\r\n    git push\r\n\r\n#. perform a pull-request using github gui\r\n\r\n|\r\n\r\nGo on vacation for 1 week\r\n Your local and origin repos now appear out-of-date.  Sync them by performing a fast-forward or merge with upstream.\r\n\r\n|\r\n\r\n#. Tell your local repo about the upstream repo\r\n\r\n   .. code-block:: bash\r\n\r\n    git remote add upstream https://github.com/saltstack/salt.git\r\n    git fetch upstream\r\n\r\n#. view all branches\r\n\r\n   .. code-block:: bash\r\n\r\n    git branch -a\r\n\r\n    * develop\r\n     remotes/origin/0.11\r\n     remotes/origin/0.12\r\n     remotes/origin/0.13\r\n     remotes/origin/HEAD -> origin/develop\r\n     remotes/origin/develop\r\n     remotes/origin/master\r\n     remotes/origin/no_ipv6\r\n     remotes/upstream/0.11\r\n     remotes/upstream/0.12\r\n     remotes/upstream/0.13\r\n     remotes/upstream/develop\r\n     remotes/upstream/master\r\n     remotes/upstream/no_ipv6\r\n\r\n \r\n#. sync local with remote upstream\r\n\r\n   .. code-block:: bash\r\n\r\n    git pull upstream develop\r\n\r\n#. push local to remote origin\r\n\r\n   .. code-block:: bash\r\n\r\n    git push origin\r\n\r\n\r\n\r\nhow to set the git commit editor\r\n======================================\r\n\r\n.. code-block:: bash\r\n\r\n   git config --global core.editor \"vim\"\r\n\r\nhow to enable colorful diffs\r\n==================================\r\n\r\n.. code-block:: bash\r\n\r\n git config --global color.ui true\r\n\r\n\r\n", "source_format": "rst", "revision_number": 18, "created": 1376649657000}}