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.
NoteSelecting 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.mdfile 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.
NoteIf 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-nameis your GitHub user name:mkdir /tmp/CodeDeployGitHubDemocd /tmp/CodeDeployGitHubDemotouch README.mdgit initgit add README.mdgit 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/CodeDeployGitHubDemolocation.
On local Windows machines:
-
From a command prompt running as an administrator, run the following commands, one at a time:
mkdir c:\temp\CodeDeployGitHubDemocd c:\temp\CodeDeployGitHubDemonotepad README.md -
In Notepad, save the
README.mdfile. Close Notepad. Run the following commands, one at a time, whereuser-nameis your GitHub user name:git initgit add README.mdgit 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\CodeDeployGitHubDemolocation.