Document my fork/branch/edit/commit/branch/pull work flow

This commit is contained in:
Gerard Vermeulen 2022-10-23 10:31:11 +02:00
parent 595953f9eb
commit b4594c11ea

View File

@ -1573,6 +1573,60 @@ single frame and to make all text visible prior to ediffing Org buffers.
(add-hook 'org-mode-hook #'ediff-with-org-show-all))
#+end_src
** [[https://git-scm.com/book/en/v2][Git]]
:PROPERTIES:
:CUSTOM_ID: sec:git
:END:
[[https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/git-push-new-branch-remote-github-gitlab-upstream-example][How to push new branches to remote repositories on Github or Gitlab]]
#+caption[Forking and branching on Github or Gitlab]:
#+caption: Forking and branching on Github or Gitlab.
#+name: lst:forking-and-branching-remote-repositories
#+begin_src shell :noeval
# Clone the repository
git clone git@github.com:gav451/engrave-faces engrave-faces-fork
cd engrave-face-fork
# Handle 1st branch:
# - Create and switch to a new branch with either:
git switch -c latex-engrave-symbolic-color-names
# or:
git checkout -b latex-engrave-symbolic-color-names
# - Create and commit changes in this branch.
# - Use "--set-upstream origin" in case of a 1st-time push:
git push --set-upstream origin latex-engrave-symbolic-color-names
# - Switch to master branch and pull:
git checkout master
git pull
# Handle 2nd branch:
# - Create and switch to a new branch with either:
git switch -c latex-engrave-dont-wrap-white-space
# - or:
git checkout -b latex-engrave-dont-wrap-white-space
# - Create and commit changes in this branch.
# - Use "--set-upstream origin" in case of a 1st-time push:
git push --set-upstream origin latex-engrave-dont-wrap-white-space
# - Switch to master branch and pull:
git checkout master
git pull
#+end_src
#+caption[List all local =git= branches]:
#+caption: List all local =git= branches.
#+name: lst:list-all-local-git-branches
#+begin_src shell :results verbatim
git -C ~/VCS/engrave-faces-fork branch -a
#+end_src
#+RESULTS: lst:list-all-local-git-branches
: latex-engrave-dont-wrap-white-space
: latex-engrave-symbolic-color-names
: * master
: remotes/origin/HEAD -> origin/master
: remotes/origin/latex-engrave-dont-wrap-white-space
: remotes/origin/latex-engrave-symbolic-color-names
: remotes/origin/master
* Reading
:PROPERTIES:
:CUSTOM_ID: sec:reading