Pulling and pushing

Next, we need to update our local repository so it knows the address of the remote repository:

$ git remote add origin https://github.com/d4nyll/hobnob.git$ git push -u origin master
Don't use https://github.com/d4nyll/hobnob.git; create your own remote repository instead. If you get a fatal: Authentication failed for https://github.com/d4nyll/hobnob.git/ error, check that your GitHub username and password are entered properly. If you use two-factor authentication (2FA) on your GitHub account, you need to use an SSH key to push to the remote repository.

The -u tag sets the upstream repository to be origin. Without it, we would have to specify which remote repository we want to push to or pull from every time we run git ...

Get Building Enterprise JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.