![]() ![]() That explains the git remote add parts of the command, but what about origin and url_to_remote_git_repo? Both of those things refer to the remote repository. Knowing that, you can guess that we're using the add sub-command to add a remote repository to the local repository. If you pass additional sub-commands to the git remote command, you can further add, remove, and modify the remote repos that your local repo is linked to. If you just issue git remote by itself, git will list all the remote repositories that your local repository knows about. Use this command to work with remote repositories. The primary git command we issued is git remote. $ git remote add origin url_to_remote_git_repo.git ![]() You will need to insert your GitHub username: # Substitute your GitHub username and your repo name where indicatedīefore we move on, let's take a look at the command we just executed. In the command line, execute the following command. We only need to perform the last two commands to link our local repository with the remote. We've already done the first four or five commands, though with some differences. Looking at just the first option, the set of git commands should look very familiar. ![]() #STANDARD NOTES GITHUB HOW TO#Now you should see instructions on how to connect your local repo to the remote one you just created on GitHub. Whether you initialize the GitHub repository with a README file or not, you need to understand conceptually the consequences.įor our example, do not initialize a README file, then click the Create repository button to create a remote repo on. You will usually create your local repo first, so you will rarely check this box. If, however, you do not check the box, you will be given instructions for creating and linking a local repo with the newly created remote repo. ![]() You will learn more about this later in the chapter. #STANDARD NOTES GITHUB CODE#Before you can push any commits to the newly created remote repo, you will need to pull the code from your remote repo into your local repo. If you check the box, it will automatically create and commit a README file in your remote repo. This is a very important step in creating your remote repo. The next thing we need to look at is the Initialize this repository with a README checkbox. If you have spaces in your repo name, GitHub will automatically replace them with hyphens. That tells us that our repo name has no problems and can be used. You will notice that GitHub has added a green checkmark in the text field where we typed our repo name. We will use my-first-repository as the name of our remote repository on GitHub. In this guide, we are going to create a remote repository on where we can push the local repository that we created in the last chapter.Īs you will see in this example, your local and remote repos do not have to have the same name. This is personal preference, and you may separate your words with any character you want except a space or tab. You cannot however have two repos by the same name under your account.Ĭhoose a descriptive name based on your project.Īs far as naming conventions, some people separate words with hyphens and some use underscores. That means that someone else can have a repository on GitHub named my-awesome-repo, and you can have one as well. The repository name has to be unique to your account. Click on that link.Ĭhoosing a repository name comes next. When you click on that, you will see a menu that includes a New Repository link. #STANDARD NOTES GITHUB PLUS#Whenever you are logged in to the GitHub website, you will see a plus icon in the upper right corner. Now that you have set up your GitHub account, it is time to learn how to use it. Some of these images may show the repository branch name as master instead of main this is not crucial for our purposes. The GitHub interface may have changed since we created these images, so the content may look a bit different. Some of the images in this chapter show pages on GitHub. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |