Step 2: Create a GitHub repository
You will need a GitHub repository to store the revision.
If you already have a GitHub repository, be sure to substitute its name for
CodeDeployGitHubDemo
throughout this tutorial, and then skip
ahead to Step 3: Upload a sample application
to your GitHub repository.
-
On the GitHub home page
, do one of the following: -
In Your repositories, choose New repository.
-
On the navigation bar, choose Create new (+), and then choose New repository.
-
-
In the Create a new repository page, do the following:
-
In the Repository name box, enter
CodeDeployGitHubDemo
. -
Select Public.
Note
Selecting the default Public option means that anyone can see this repository. You can select the Private option to limit who can see and commit to the repository.
-
Clear the Initialize this repository with a README check box. You will create a
README.md
file manually in the next step instead. -
Choose Create repository.
-
-
Follow the instructions for your local machine type to use the command line to create the repository.
Note
If you have enabled two-factor authentication on GitHub, make sure you enter your personal access token instead of your GitHub login password if prompted for a password. For information, see Providing your 2FA authentication code
.
On local Linux, macOS, or Unix machines:
-
From the terminal, run the following commands, one at a time, where
user-name
is your GitHub user name:mkdir /tmp/CodeDeployGitHubDemo
cd /tmp/CodeDeployGitHubDemo
touch README.md
git init
git add README.md
git commit -m "My first commit"
git remote add origin https://github.com/
user-name
/CodeDeployGitHubDemo.gitgit push -u origin master
-
Leave the terminal open in the
/tmp/CodeDeployGitHubDemo
location.
On local Windows machines:
-
From a command prompt running as an administrator, run the following commands, one at a time:
mkdir c:\temp\CodeDeployGitHubDemo
cd c:\temp\CodeDeployGitHubDemo
notepad README.md
-
In Notepad, save the
README.md
file. Close Notepad. Run the following commands, one at a time, whereuser-name
is your GitHub user name:git init
git add README.md
git commit -m "My first commit"
git remote add origin https://github.com/
user-name
/CodeDeployGitHubDemo.gitgit push -u origin master
-
Leave the command prompt open in the
c:\temp\CodeDeployGitHubDemo
location.