From b4594c11eab57648a42ded5b381459684619c341 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Sun, 23 Oct 2022 10:31:11 +0200 Subject: [PATCH] Document my fork/branch/edit/commit/branch/pull work flow --- README.org | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/README.org b/README.org index fe9b4b0..3c1ad44 100644 --- a/README.org +++ b/README.org @@ -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