diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..585408f --- /dev/null +++ b/.gitignore @@ -0,0 +1,58 @@ +# This .gitignore is based on https://github.com/github/gitignore + +# Java +*.class +*.jar +*.war +*.ear + +# Maven +target/ + +# JRebel +rebel.xml + +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ + +# Eclipse +*.pydevproject +.project +.metadata +bin/** +tmp/** +tmp/**/* +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath +.externalToolBuilders/ +*.launch +.cproject +.buildpath + +# VIM +.*.sw[a-z] +*.un~ +Session.vim + +# OS X +.DS_Store +._* +.Spotlight-V100 +.Trashes + +# Windows +[Tt]humbs.db +Desktop.ini +$RECYCLE.BIN/ + +/node_modules +package-lock.json diff --git a/README.md b/README.md index 9ed6326..740cc45 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Git for Confluence test repository +# Git for Confluence reference repository This repository contains a set of files in different formats that you can use to try out the Git for Confluence app. This repository comes preconfigured when @@ -9,31 +9,63 @@ view-git-file macro on any Confluence page. ## Marketplace You can install Git for Confluence by using the Universal Plugin Manager inside -Confluence, or by visiting the [Git for Confluence marketplace entry][1] +Confluence, or by visiting the +[Git for Confluence marketplace entry](https://marketplace.atlassian.com/apps/1211675/git-for-confluence). ## Documentation If you want to learn how to configure Git for Confluence or use the Git for -Confluence macro's, please refer tot the [Git for Confluence documentation][2] +Confluence macro's, please refer tot the +[Git for Confluence documentation](https://avisi-apps.gitbook.io/git-for-confluence/). # Formats +The are three main classes of formats that the Git for Confluence add-on natively +supports. These consist of Markdown, Image and PlantUML files. Showcase examples +that demonstrate how these can be used and rendered in Confluence are available +in the formats directory: +```bash +. +├── README.md +└── formats + ├── code + │ └── index.html + ├── image + │ ├── graph.png + │ ├── logo.svg + │ ├── success.jpg + │ ├── tv.webp + │ └── world.ico + ├── markdown + │ ├── image-reference.md + │ └── images + │ └── success.jpg + └── plantuml + ├── multi-block.puml + ├── multi-page.puml + └── simple-sequence-diagram.puml +``` +These files can be directly added to the ``view-git-file`` Macro in Confluence +and will be rendered on a page. + ## Image Several images in several formats are available in the formats/markdown folder. -An images will simply be show as an image when included on a Cofluence page by -using the view-git-file macro. +An image will simply be show as an image when included on a Confluence page by +using the ``view-git-file`` macro. Currently we support the following extensions: +* .png +* .jpg +* .webp +* .ico ## Markdown -You can simply use the view-git-file macro to include this file. There are +You can simply use the ``view-git-file`` macro to include this file. There are more markdown examples in the formats/markdown folder. ## PlantUML There are a few basic and a few more advanced PlantUML examples available in the formats/plantuml folder. Try out a basic sequence diagram, or the more -advanced examples, that result in multiple images on your Confluene page. - -[1]: https://marketplace.atlassian.com/apps/1211675/git-for-confluence -[2]: https://avisi-apps.gitbook.io/git-for-confluence/ +advanced examples, that result in multiple images on your Confluence page when +rendered with the ``view-git-file`` macro. diff --git a/formats/code/index.html b/formats/code/index.html new file mode 100644 index 0000000..513e968 --- /dev/null +++ b/formats/code/index.html @@ -0,0 +1,112 @@ +--- +layout: reference +--- +
+ This is the Git reference site. It is meant to be a quick + reference for learning and remembering the most important and + commonly used Git commands. The commands are organized into + sections of the type of operation you may be trying to do, and + will present the common options and commands needed to accomplish + these common tasks. +
++ Each section will link to the next section, so it can be used + as a tutorial. Every page will also link to more in-depth + Git documentation such as the official manual pages and relevant + sections in the Pro Git book, + so you can learn more about any of + the commands. First, we'll start with thinking about source code + management like Git does. +
++ The first important thing to understand about Git is + that it thinks about version control very differently than + Subversion or Perforce or whatever SCM you may be used to. It + is often easier to learn Git by trying to forget your assumptions + about how version control works and try to think about it in the + Git way. +
+ ++ Let's start from scratch. Assume you are designing a new source + code management system. How did you do basic version control before + you used a tool for it? Chances are that you simply copied your + project directory to save what it looked like at that point. +
+ +$ cp -R project project.bak+ +
+ That way, you can easily revert files that get messed up later, or + see what you have changed by comparing what the project looks like + now to what it looked like when you copied it. +
+ ++ If you are really paranoid, you may do this often, maybe putting the + date in the name of the backup: +
+ +$ cp -R project project.2010-06-01.bak+ +
+ In that case, you may have a bunch of snapshots of your project that + you can compare and inspect from. You can even use this model to + fairly effectively share changes with someone. If you zip up your + project at a known state and put it on your website, other developers + can download that, change it and send you a patch pretty easily. +
+ ++ $ wget http://example.com/project.2010-06-01.zip + $ unzip project.2010-06-01.zip + $ cp -R project.2010-06-01 project-my-copy + $ cd project-my-copy + $ (change something) + $ diff project-my-copy project.2010-06-01 > change.patch + $ (email change.patch)+ +
+ Now the original developer can apply that patch to their copy of the + project and they have your changes. This is how many open source + projects have been collaborated on for several years. +
+ ++ This actually works fairly well, so let's say we want to write a tool + to make this basic process faster and easier. Instead of writing a tool + that versions each file individually, like Subversion, we would probably + write one that makes it easier to store snapshots of our project without + having to copy the whole directory each time. +
+ +
+ This is essentially what Git is. You tell Git you want to save a snapshot
+ of your project with the git commit command and it basically
+ records a manifest of what all of the files in your project look like at
+ that point. Then most of the commands work with those manifests to see
+ how they differ or pull content out of them, etc.
+

+ If you think about Git + as a tool for storing and comparing and merging snapshots of your project, + it may be easier to understand what is going on and how to do things + properly. +
+ +