12/21/2023 0 Comments Git add remote to local repositoryWe can send our latest work to and retrieve the latest work from the remote. Now that we added a remote repo, there are two actions. # Verify remote's new name # destination (fetch) # destination (push)įor consistency's sake, let's go ahead and rename destination back to origin: git remote rename destination origin # Change remote name from 'origin' to 'destination' # View existing remotes # origin (fetch) # origin (push) Let's try changing the name of the repo to destination: git remote -v What is origin? "Origin" is simply the default alias assigned to your new remote repo, but we could rename it to anything. This sets the remote, so you can push and pull code. git remote add origin your-remote-repository-URL.Add and commit the new file created in step 1. Add some text to the new file: echo "This is my readme file" > README.md.Create a new file named README.md: touch README.md.Change into the newly-created directory: cd my_new_directory.Create a new directory named my_new_directory: mkdir my_new_directory.If your development directory is named something other than ~/code, that's fine - cd into whatever yours is called.Change into your code directory: cd ~/code.In your terminal, create a new directory and add a file.(We'll use this in the next section.)Ĭonnecting your remote repo to a local repo Click the "Copy to clipboard" symbol next to the repo URL (pictured) to copy the URL. After you create the repo, you should see a "Quick setup" page. Click the green Create repository button. You can name it whatever you'd like be creative! The default options are fine as-is - don't initialize the new repository with a README or add a. Enter a name for your repository in the Repository name field.While logged into GitHub, click the in the menubar and select New repository.However, this is rarely the case, and we want to work with others! So, we have to talk about remotes. If you don't want to work with anyone else, you don't need remotes. It's just another git repository in the cloud. GitHub does nothing special in the git universe. Use git push to connect your local repository of files to your remote repository.Describe GitHub and its relationship with Git.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |