Setting up your repository - RedHatInsights/red-hat-ansible-automation-platform-documentation GitHub Wiki

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.

  3. Clone the forked repository locally.

    $ git clone [email protected]:<your_github_username>/red-hat-ansible-automation-platform-documentation.git
    • The git clone command copies the forked repository from your account on the GitHub server into a directory called red-hat-ansible-automation-platform-documentation 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 red-hat-ansible-automation-platform-documentation 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]:RedHatInsights/red-hat-ansible-automation-platform-documentation.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

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/red-hat-ansible-automation-platform-documentation.git (fetch)
origin	[email protected]:ariordan-redhat/red-hat-ansible-automation-platform-documentation.git (push)
upstream	[email protected]:RedHatInsights/red-hat-ansible-automation-platform-documentation.git (fetch)
upstream	[email protected]:RedHatInsights/red-hat-ansible-automation-platform-documentation.git (push)

To verify that you can access the git remotes, fetch the latest updates from upstream, and view the latest commits in the remotes.

$ 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 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)
⚠️ **GitHub.com Fallback** ⚠️