

This will push your code up to the remote repo/branch you're tracking.

You can also implicitly push your code by running: git push To find all the branch names, run git branch -r. In the example below, we're pushing to the master branch of our remote repository, referred to as origin. The second is the name of the remote branch you want to send code to. You don't actually have to enter the repository name. Remember, origin is just an alias that refers to the repository name. The first is the name of the remote repo. We use this command when we want to send some code from the local repository to the associated remote repository. We 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.

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.
