|
|
| | | |
| git config --global core.editor "vim" | | git config --global core.editor "vim" |
| t | | t | |
| | | how to enable colorful diffs |
| | | ================================== |
| | | |
| | | .. code-block:: bash |
| | | |
| | | git config --global color.ui true |
| | | |
| | | |
|
|
| t | | t | git notes |
| | | ######### |
| | | |
| | | .. contents:: |
| | | |
| | | |
| | | |
| Set a local repo or global username | | Set a local repo or global username |
| ======================================= | | ======================================= |
|
|
| | | |
| git push origin | | git push origin |
| t | | t | |
| | | |
| | | |
| | | how to set the git commit editor |
| | | ====================================== |
| | | |
| | | .. code-block:: bash |
| | | |
| | | git config --global core.editor "vim" |
|
|
| ================================ | | ================================ |
| | | |
| n | git push origin master | n | if this is your first commit/push: |
| | | |
| t | How to add upstream master | t | .. code-block:: bash |
| | | |
| | | git push origin master |
| | | |
| | | else: |
| | | |
| | | .. code-block:: bash |
| | | |
| | | git push |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
|
|
| .. code-block:: bash | | .. code-block:: bash |
| | | |
| t | git push origin develop | t | git push origin |
|
|
| .. code-block:: bash | | .. code-block:: bash |
| | | |
| t | git merge upstream/develop | t | git pull upstream develop |
| | | |
| #. push local to remote origin | | #. push local to remote origin |
|
|
| | | |
| | | |
| n | #. get synced up with | n | #. sync local with remote upstream |
| | | |
| .. code-block:: bash | | .. code-block:: bash |
| | | |
| t | git merge upstream/master | t | git merge upstream/develop |
| | | |
| | | #. push local to remote origin |
| | | |
| | | .. code-block:: bash |
| | | |
| | | git push origin develop |
|
|
| git remote add upstream https://github.com/saltstack/salt.git | | git remote add upstream https://github.com/saltstack/salt.git |
| git fetch upstream | | git fetch upstream |
| n | # should create a bunch more branches, to view: | n | |
| | | #. view all branches |
| | | |
| | | .. code-block:: bash |
| | | |
| git branch -a | | git branch -a |
| | | |
| n | | n | * develop |
| | | remotes/origin/0.11 |
| | | remotes/origin/0.12 |
| | | remotes/origin/0.13 |
| | | remotes/origin/HEAD -> 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 |
| | | |
| t | | t | |
| | | #. get synced up with |
| | | |
| | | .. code-block:: bash |
| | | |
| | | git merge upstream/master |
|
|
| | | |
| git remote add upstream https://github.com/saltstack/salt.git | | git remote add upstream https://github.com/saltstack/salt.git |
| t | | t | git fetch upstream |
| | | # should create a bunch more branches, to view: |
| | | git branch -a |
| | | |
| | | |
|
|
| #. perform a pull-request using github gui | | #. perform a pull-request using github gui |
| | | |
| t | | t | | |
| | | |
| Go to vacation for 1 week | | Go on vacation for 1 week |
| Your local and origin repositories appear out-of-date. Sync them by performing | | Your local and origin repos now appear out-of-date. Sync them by performing a |
| a fast-forward or merge with upstream. | | fast-forward or merge with upstream. |
| | | |
| | | | |
| | | |
| #. Tell your local repo about the upstream repo | | #. Tell your local repo about the upstream repo |
|
|
| Your local and origin repositories appear out-of-date. Sync them by performing | | Your local and origin repositories appear out-of-date. Sync them by performing |
| a fast-forward or merge with upstream. | | a fast-forward or merge with upstream. |
| | | |
| n | | n | #. Tell your local repo about the upstream repo |
| | | |
| t | | t | .. code-block:: bash |
| | | |
| | | git remote add upstream https://github.com/saltstack/salt.git |
| | | |
| | | |
|
|
| cd ~/git | | cd ~/git |
| git clone https://github.com/russellballestrini/salt.git | | git clone https://github.com/russellballestrini/salt.git |
| t | | t | 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 to vacation for 1 week |
| | | Your local and origin repositories appear out-of-date. Sync them by performing |
| | | a fast-forward or merge with upstream. |
| | | |
| | | |
|
|
| | | |
| pull changes from upstream, perform merges and fast forwards to keep sync'd | | pull changes from upstream, perform merges and fast forwards to keep sync'd |
| t | | t | |
| | | example using salt repo |
| | | ------------------------------- |
| | | |
| | | #. 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 |
| | | |
| | | |
|
|
| n | Set local repo or global username | n | Set a local repo or global username |
| ======================================= | | ======================================= |
| | | |
| | | |
| git push origin master | | git push origin master |
| t | | t | |
| | | How to add upstream master |
| | | |
| | | |
| | | |
| | | 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 |
|
|
| git config --global user.name "foxhop" | | git config --global user.name "foxhop" |
| git config --global user.email "foxhop@foxhop.net" | | git config --global user.email "foxhop@foxhop.net" |
| t | | t | |
| | | How to push to remote master |
| | | ================================ |
| | | |
| | | git push origin master |
| | | |
|
|
| | | |
| git config --local user.name "fox" | | git config --local user.name "fox" |
| n | | n | git config --local user.email "fox@localhost" |
| | | |
| git config --global user.name "foxhop" | | git config --global user.name "foxhop" |
| t | | t | git config --global user.email "foxhop@foxhop.net" |
| | | |
|
|
| ======================================= | | ======================================= |
| | | |
| t | | t | .. code-block:: bash |
| | | |
| git config --local user.name "fox" | | git config --local user.name "fox" |
| git config --global user.name "foxhop" | | git config --global user.name "foxhop" |
|
|
| t | | t | Set local repo or global username |
| | | ======================================= |
| | | |
| | | git config --local user.name "fox" |
| | | git config --global user.name "foxhop" |