Git for Confluence Cloud
  • Git for Confluence Cloud
  • Release notes
    • August 6th, 2024
    • June 5 2024
    • June 7th, 2023
    • March 14th, 2023
    • October 20th, 2022
    • October 3rd, 2022
    • August 30, 2022
    • August 8th, 2022
    • July 25th, 2022
    • July 20th, 2022
    • June 30th, 2022
  • Installation
    • Installation
  • Git Support
    • Git providers
    • Filetypes
    • Demo Confluence pages
    • Demo videos
  • How to use the app
    • Share Git file macro
    • Share Git folder macro
    • Authorization
    • Shared Git files overview
    • Troubleshooting
  • Administration
    • Authentication methods
    • Migration of consent
    • User management
    • Audit log
  • Example use cases
    • Software architecture document
    • Public documentation
  • Security
    • F.A.Q.
    • OAuth scopes and API endpoints
      • Github OAuth scopes
      • Bitbucket OAuth scopes
      • Gitlab OAuth scopes
      • Azure DevOps OAuth scopes
    • Access token scopes and API endpoints
      • Github access token scopes
      • Bitbucket access token scopes
      • Gitlab access token scopes
      • Azure DevOps access token scopes
  • Relevant Links
    • Pricing
    • Privacy & Security
    • Marketplace
    • Support
    • Visualizer for Confluence
Powered by GitBook
On this page
  • Using the macro
  • Adding the macro
  • Share this file - what does it mean?
  • Revoking a shared Git file
  • No access to the Git file
  • No Git file found
  1. How to use the app

Share Git file macro

The Share Git file macro allows you to add a Git file to the content of a Confluence page. The content of the macro will be kept up-to-date with the Git repository.

PreviousDemo videosNextShare Git folder macro

Last updated 1 year ago

Using the macro

The easiest way to share your Git files is to paste the link of your Git file into your Confluence page. URLs from supported providers are automatically converted to the 'Share Git file' macro.

URLs to public Git files are immediately visible. If the pasted URL is a link to a private Git file, you will have to edit the macro to share it on your behalf.

Adding the macro

You can add the 'Share Git file' macro to a Confluence page by using the macro browser. Alternatively, you can start typing /share git and Confluence will suggest to add the 'Share Git file' macro.

When editing the macro you will be presented with a text-field to fetch a Git file from a URL. When providing a valid URL, the macro will fetch the file and display a preview of it's contents. Then you can press the Share this file button to add the content to the Confluence page.

Share this file - what does it mean?

In order to display private Git files on a Confluence page, a person who is allowed to share private files must give permission to share this file. You do this with the share on my behalf button.

This links this person in Confluence to the Git file. That means the Git file will remain visible on Confluence as long as:

  • Using Auth 2.0 - this person in the repository continues to have access to this file , or until the sharing permission is revoked or taken over.

  • Using Shared Access Token - the configured access token has access to the file, or until the sharing permission is revoked.

Revoking a shared Git file

No access to the Git file

When you paste a URL from a Git file that you don't have access to in the repository, Git for Confluence won't be able to display content. When fetching via the 'Share Git file' macro, you will also get a warning that you don't have the required permissions to view that file.

Since the macro is available on the page, somebody else who does have the required permissions to view the Git file can edit the macro and share the Git file on their behalf. After that everyone will be able to view the Git file.

No Git file found

When you paste a URL to a Git file that does not exist, it is not possible to render a file.

When fetching via the 'Share Git file' macro, you are not able to add the macro to your page. If you paste the link directly into the file, the link will remain visible and will not turn into a macro.

Once you have shared a Git file you can revoke that share by editing the macro. You will be presented with a dialog similar to that of adding a Git file. This time you will see a button indicating that you can Revoke this share. Alternatively you can navigate to the , where you'll find an overview of all your shared Git files.

shared Git files overview