From fff00fdb4b684bf384a465e11cb4299f8fa48971 Mon Sep 17 00:00:00 2001 From: Daniel Chadwick Date: Fri, 17 Jan 2025 11:06:34 -0500 Subject: [PATCH] commiting cheat sheet --- docs/OCP_writer_cheatSheet.adoc | 219 ++++++++++++++++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 docs/OCP_writer_cheatSheet.adoc diff --git a/docs/OCP_writer_cheatSheet.adoc b/docs/OCP_writer_cheatSheet.adoc new file mode 100644 index 0000000..06a7560 --- /dev/null +++ b/docs/OCP_writer_cheatSheet.adoc @@ -0,0 +1,219 @@ += Use `=` for the document titleJohn Doe + +== Use `==` for a level 1 section title + +=== Use `===` for a level 2 section title + +==== Use `====` for a level 3 section title + +A paragraph of text goes here. This is a simple paragraph demonstrating how to create regular text. + +==== Special sections + +.Prerequisites +* A dot (.) at the beginning of a line that is immediately followed by a word with no space between the dot and the word creates a special section. +* We typically use special sections to block off prerequisites and procedures. +* A dot followed by a space followed by a word creates an ordered list item. Make sure you use your dotes wisely! +* Item four + +.Procedure +. Step one +. Step two + +==== Lists + +* Use `*` for a bullet list item. +* Another bullet item. +** Use `**` for a second-level bullet list item. +*** Use `***` for a third-level bullet list item. + +. Use `.` for an ordered list item. +. Another ordered item. +.. Use `..` for a second-level ordered list item. +... Use `...` for a third-level ordered list item. + +==== Links + +Link to an external website: http://example.com[Example Link] + +Link to a section within the document: <<_section,Section Title>> + +==== Includes + +Include another file: include::path/to/file.adoc[] + +==== Images + +image::path/to/image.png[Image Title] + +==== Tables + +[cols="3*"] +|=== +|Column 1 |Column 2 |Column 3 + +|Row 1, Column 1 +|Row 1, Column 2 +|Row 1, Column 3 + +|Row 2, Column 1 +|Row 2, Column 2 +|Row 2, Column 3 +|=== + +==== Code blocks + +[source,python] +---- +def hello_world(): + print("Hello, World!") +---- + +==== Terminal Commands + +[source,bash] +---- +$ ls -la +$ git status +---- + +==== YAML Code + +[source,yaml] +---- +version: '3' +services: + web: + image: nginx + ports: + - "80:80" + database: + image: mysql + environment: + MYSQL_ROOT_PASSWORD: example +---- + +==== Code and commands within lists + +When writing your procedures, you may notice that the numbered list begins again at 1 after a list item that contains a code block. Keep code within the list item by include a `+`. + +.Example + +. List item 1 ++ +[source,python] +---- +def hello_world(): + print("Hello, World!") +---- + +. List item 2 + +==== Quotes + +[quote,Author,Book Title] +____ +This is a block quote. +____ + +==== Notes and admonitions + +[NOTE] +==== +This is a note block. +==== + +[TIP] +==== +This is a tip block. +==== + +[IMPORTANT] +==== +This is an important message. +==== + +[WARNING] +==== +This is a warning message. +==== + +[CAUTION] +==== +This is a caution message. +==== + +NOTE: You can also make a note (or any other block) like this, but we typically don’t. + +==== Inline Formatting + +*Italic text* can be created using asterisks. +**Bold text** can be created using double asterisks. +`Monospaced text` can be created using backticks. + +==== Comments + +// This is a comment. Use `//` at the start of a line to create a comment. + += 5 most common git procedures + +== Update your local branch + +[source,git] +---- +// Switches to the main branch +git checkout main + +// Fetches changes from the upstream repository +git fetch upstream + +// Reapplies commits from the current branch onto the latest changes from upstream/main +git rebase upstream/main + +// Pushes the updated main branch to the origin repository +git push origin main +---- + +== Create a new feature branch + +[source,git] +---- +// Creates a new branch with the specified name +git checkout -b +---- + +== Stage and push changes + +[source,git] +---- +// Stages all changes +git add . + +// Commits the changes with a message +git commit -m ": message goes here" + +// Forces a push of the branch to the origin repository +git push origin --force +---- + +== Make changes to an existing PR + +[source,git] +---- +// Switches to the branch with the specified name +git checkout +// Make changes in the working directory + +// Stages all changes +git add . + +// Commits the changes with a message +git commit -m ": message goes here" + +// Interactively rebases the last 2 commits +git rebase -i HEAD~2 + +// Forces a push of the branch to the origin repository +git push origin --force +---- +