-
Notifications
You must be signed in to change notification settings - Fork 1
Setting Up Git
Git has a few things that you need to configure in order to use it without a hitch
First off, you need to set the name and email address to sign your commits with, so that other people know who to get in touch with regarding questions with your code
$ git config --global user.name "{name}"
$ git config --global user.email {email}
Where {name}
is your name and {email}
is your email address, of course. If I were to run the commands above, they would look like this:
$ git config --global user.name "Alex LaFroscia"
$ git config --global user.email [email protected]
This means that every time you run git push
only the current branch is pushed, not every branch.
$ git config --global push.default simple
You also have to do a one-time setup between your computer and Github, so Github can make sure that it's you when you're trying to interact with your git repositories. The guide that Github provides for this is excellent, so instead of re-writing it myself, I will just point you to it.
Github's guide to adding SSH keys to Github
Windows Users: You might see something about a command called
pbcopy
that will not work on Windows. If you see this, it's just asking you to copy the contents of that file to the clipboard. You can open that file in a text editor and copy the contents that way instead.
You can also set up more basic authentication over HTTPS, but I highly recommend SSH instead because using SSH authentication makes enabling 2-factor authentication on your Github account a lot easier.
- Beginner Level