News Stay informed about the latest enterprise technology news and product updates.

How to create a GitHub repository

The GitHub repository is the central artifact around which all aspects of GitHub-based DevOps revolve. To master GitHub, you must master the fundamentals of the GitHub repository.

 

The GitHub repository lifecycle

The GitHub repository goes through a four-phase lifecycle:

  1. GitHub repository creation
  2. Repeated GitHub repository cloning
  3. A possible need to rename the GitHub repository
  4. A GitHub repository delete

GitHub repository creation steps

create GitHub repo

How to create a GitHub repository

To create a GitHub repository, simply click the green New button on the repositories page. The basic steps required to create a GitHub repository are:

  1. Specify the name of the GitHub repository
  2. Include an optional description
  3. Specify if it will be a public or private GitHub repository
  4. Choose to optionally add a README file
  5. Choose to optionally add a .gitignore file
  6. Optionally add a fair use license
  7. Click the green Create Repository button to finish the process

The GitHub URL

Once created, the GitHub repository URL can be used by programmers and DevOps professionals to clone the repository. The GitHub URL takes on the following format:

http://<github.com>/<repository-owner>/<repository-name>.git

To use the GitHub URL to clone my personal github-made-easy repository, the command would look as follows:

git clone https://github.com/cameronmcnz/github-made-easy.git

Note that this command will perform a non-bare clone on all branches and save the repository in a subfolder with the same name as the repository. If you want to only git clone a specific branch, or git clone into a directory, you can use optional switches of the git clone command. Furthermore, if the repository has git submodules, then you must take extra steps to init and update the submodules.

How to rename a GitHub repo

From time to time, the situation arises where you must rename a GitHub repo. To do so:

  1. Log into the GitHub administrative console
  2. Click on the repository to rename
  3. Navigate to the repository’s Settings page
  4. At the top of the settings page, enter a new GitHub repository name
  5. Click the Rename button

Delete GitHub repo tutorial

When you’re no longer actively developing your project, you can delete the GitHub repository. To accomplish this:

  1. Log into the GitHub administrative console
  2. Click on the repository to delete
  3. Navigate to the repository’s Settings page
  4. Scroll down to the Danger Zone section
  5. Click the Delete this repository option
  6. Confirm the name of the repository
  7. Click Delete

And that completes the basic operations associated with the lifecycle of a GitHub repository.

SearchAppArchitecture

SearchSoftwareQuality

SearchCloudComputing

SearchSecurity

SearchAWS

Close