Lab Activity - Exercise 12 - Create and Connect A GitHub Repository
Lab Activity - Exercise 12 - Create and Connect A GitHub Repository
SA
In this exercise, you will create a public GitHub 1 repository for the source code of your
application.
Task Flow
Prerequisite
To create a GitHub repository, you need a CAP project and a GitHub user. If you do not have a
GitHub user, sign up for GitHub first.
c) As the Repository name, enter RiskManagement. Don't tick any of the Initialize this
repository with checkboxes.
d) Choose Create repository
To create a personal access token, which you can use instead of a password, follow the steps
described in Creating a personal access token 2.
You have created a new, empty GitHub repository. To be able to use it as a repository for your
risk management application source code, you need to connect it with your CAP project. Until
now, the only place where your project's source code resided was your personal dev space in
SAP Business Application Studio.
c) Enter your email address and username. You can use the email address that you've used to
register your GitHub account
This configures the git command line tool locally in your Business Application Studio dev space.
Now when you do file changes and commit them to a git history, git will use the configured
name and email in these commits.
Since we cloned the starter template from GitHub, we already have a GitHub repository.
Therefore, we do not have to create a new local one. All we have to do is to commit all our
recent changes, link the new GitHub repository with our local one and to push the changes to
GitHub.
c) Add your copied GitHub repository URL from the previous part of the exercise as remote
repository (without the angle brackets '<' and '>' ):
Perform the command:git remote set-url origin <copied Git repository url.git>
This tells your local git repository in the Business Application Studio dev space, that it has a
remote counterpart on GitHub. The remote counterpart should act as the origin, thus it is the
repository that you and your colleagues use as the central repository of your project.
d) Push the commit with your project content to this GitHub repository:
This tells your local git to push the main branch to the remote repository. The -u option is used
because the branch main did not yet exist on the remote repository.
e) When prompted, enter your GitHub username and the personal access token, that you have
created previously
You have connected your CAP project with your public GitHub repository using git commands