Skip to content

Setting up your repository

Aine Riordan edited this page Aug 29, 2023 · 5 revisions

Setting up your repository

Before you begin:

If you also want to interact with the AAP Gitlab repository, these extra prerequisites apply:

Setting up your copy of the repository

  1. Fork the upstream repository to create a copy in your own GutHub account.

    From the main page of the GitHub repository, click Fork in the upper right corner.

  2. Open a terminal on your machine and navigate to the directory where you want to store your local copy of the repository. Make sure that the directory you have chosen is separate from any other git repo. Cloning a git repo within another repo is messy.

  3. Clone the forked repository locally.

    $ git clone [email protected]:<your_github_username>/aap-docs.git
    • The git clone command copies the forked repository from your account on the GitHub server into a directory called aap-docs on your local machine.

    • It sets your forked repository as a git remote called origin.

      If the command fails, be sure that you have set up an SSH key for GitHub.

  4. In a terminal, navigate to the aap-docs directory.

  5. Set the upstream remote repository. This configures a connection labeled upstream between your local cloned repository and the remote upstream repository on GitHub.

    $ git remote add -f upstream [email protected]:ansible/aap-docs.git
  6. If you need to interact with the AAP Gitlab repository, configure a remote repository called gitlab:

    $ git remote add gitlab [email protected]:red-hat-cloud-services-software-documentation/red-hat-ansible-automation-platform-documentation.git
  7. If you want to interact with the old RedHatInsights AAP docs repo, you must configure a git remote called insights.

    $ git remote add -f insights [email protected]:RedHatInsights/red-hat-ansible-automation-platform-documentation

Verification

Check that you have correctly configured your connections to the remote git repositories.

$ git remote -v
gitlab	[email protected]:red-hat-cloud-services-software-documentation/red-hat-ansible-automation-platform-documentation.git (fetch)
gitlab	[email protected]:red-hat-cloud-services-software-documentation/red-hat-ansible-automation-platform-documentation.git (push)
origin	[email protected]:ariordan-redhat/aap-docs.git (fetch)
origin	[email protected]:ariordan-redhat/aap-docs.git (push)
upstream	[email protected]:ansible/aap-docs.git (fetch)
upstream	[email protected]:ansible/aap-docs.git (push)

To verify that you can access the git remotes, fetch the latest updates from upstream and gitlab, and view the latest commits in the remotes. Connect to the VPN if you want to view the Gitlab log.

$ git fetch upstream
$ git log --oneline -n 2 upstream/main
7c3291d (HEAD -> main, upstream/main, origin/main, origin/HEAD) Update roles and collections content in dev guide  (#142)
f34322a First draft of operator install procedures (#154)

$ git log --oneline -n 2 origin/main
7c3291d (HEAD -> main, upstream/main, origin/main, origin/HEAD) Update roles and collections content in dev guide  (#142)
f34322a First draft of operator install procedures (#154)

$ git fetch gitlab
$ git log --oneline -n 2 gitlab/2.1
0329655 (upstream/2.1, gitlab/2.1) AAP-2029: Fixed sentences (#291)
0a93b45 AAP-2328 Configuring external database for hub/controller on a AAP operator (#288) (#289)
be3d6ec AAP-2853 Update Providing feedback info (#285) (#286)
Clone this wiki locally