To create a new repository on GitHub, login to your account and follow these steps:
Once the repository is created, GitHub will suggest some instructions to start working with your new repository. Since you already have a local repository, you will need to follow the instructions for “…or push an existing repository from the command line”. Copy the command provided and run it in the terminal of your local git repository.
You should see a response similar to this:
Once you have done this, refresh your repository page on GitHub and you should see the content of the wakeuptimes-app
folder uploaded to your GitHub repository.
README.md
file to the repositoryTo add a README.md
file to your GitHub repository, follow these steps:
README.md
file as the description of your repository.To fetch changes from GitHub, open the terminal in your local git repository for this project and run the following commands:
This should result in a response similar to the following:
Notice that the README.md
file created on GitHub is now fetched and pulled down to your local repository.
GitHub makes it easy to share your coding projects. The process of downloading a GitHub repository to your computer is called “cloning.” When you clone a repository, you get a copy of its history as a local Git repository. Downloading a repository (as opposed to cloning) only downloads the files from the most recent commit. Let’s try it.
In the wakeuptimes-app
folder, delete all the files using the following command:
Next, run the following command, replacing <repository>
with the URL of your GitHub repository (the one we made in the previous steps). Notice the trailing dot (.
) at the end of the command, which indicates copying the repository content into the current folder.
You now should have all the files you had deleted! This is a clone (a copy) of the GitHub repository.