-
Notifications
You must be signed in to change notification settings - Fork 48
Setting up your repository
Before you begin:
-
You must have a GitHub account.
-
You must have set up an SSH key for your GitHub account.
If you also want to interact with the AAP Gitlab repository, these extra prerequisites apply:
-
You must be connected to the VPN
-
You must be a member of the Documentation - CCS Internal group in Gitlab
-
You must be able to open the Gitlab repo in a browser: https://gitlab.cee.redhat.com/red-hat-cloud-services-software-documentation/red-hat-ansible-automation-platform-documentation
-
You must have set up an SSH key for your GitHub account.
-
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.
-
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.
-
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 calledaap-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.
-
-
In a terminal, navigate to the
aap-docs
directory. -
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
-
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
-
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
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)
-
Repository branch structure
-
Forking workflow
-
git cherry-pick
-
List open pull requests