Git add remote command
In this case, we only have one, with the nickname al. This shows us all the remotes stored in Git for this project. To see that Git has done this successfully, we can run this command: $ git remote -v Ours is in the example above, but yours will likely differ. Note that your command should contain the URL location for your GitHub repo. We could use any nickname for the remote but we've chosen al for brevity and to be consistent with the initials we are using as pairs. This command tells Git to store information about a remote repository that we gave the nickname, al (the initials for one partner - Ada Lovelace) located at. Now we need to tell Git where our remote repository is by providing the web address. We also ensure that there aren't any outstanding changes that we still need to commit: $ git status In this case, we open it in the browser and it looks good.
#Git add remote command code#
In our project directory, we will make sure our code is working. With an empty repository awaiting our code, we can now follow the steps to push our code from our local repository to the remote repository. We will be exploring what a README is and how we add it to our repositories in a future lesson.
A README file is a detailed description of the repository including information like authors, usage instructions and licensing. The last option asks whether or not to initialize the repository with a README. We recommend that you set the repositories you create at Epicodus to public so that you can show your journey as a developer through your code. A private repository is one that only you can see. A public repository means that everyone can see the contents of the repository but as the owner of it, you will be the only person who can determine what code can be committed to it. You can have public or private repositories. Though the description is optional, it can be helpful to our future selves and anyone else looking at our repository to see a quick description of its content.
For this project, we'll enter "hello-world". Let's walk through the options we need to complete for our new repository.įirst, we enter the repository name that matches the name of our project directory. Once logged in, we'll select the New Repository or New button to go to the Create a new repository screen: Each pair partner creates a remote repository using their own GitHub account. Creating a GitHub repositoryįirst, we need to create the remote repository on GitHub. git repository to a remote repository on GitHub now. We will be saving our code remotely to repositories on GitHub. A remote repository is one that is saved in a location outside of your device but still accessible by it. If you want to see your code on another device, you will not be able to access it. For example, the projects that you build on Epicodus machines have local. When we talk about a local repository, we mean one that is accessible only when using the device where it is saved. In this lesson, we'll dive in to using GitHub to store our code remotely.įirst, let's talk about the difference between local and remote. When we want to publish our code to the world (or just save it on the cloud so we can access it from any device), we want to store it in a remote repository. It is also being tracked by Git in the local. The main version of our Hello World website is saved on the machines that we used to code the HTML file, hello-world.html.