Preface
You don’t have to learn gIt commands, you can download the GitHub Desktop App if you wish to use a GUI, but it is still important to learn about what each function does.
Also in most modern IDEs, there are GUIs for a lot of the git stuff, so the need to type into a command line is even less, but still good to know.
This guide assumes you have at least a basic knowledge of what “source control” is, if not, a quick Google search about “git” or “source control” will do.
Git has too many commands and functions to go over, read it yourself.
Setting up git
- Make a GitHub Account
- Download git and set it up → bash is sufficient (link is assuming u r on Windows, should also work for Mac, check specific commands for Linux/Unix)
Setting up SSH with git (optional, you can always use username password, but this is much faster)
- Follow the guide on GitHub Docs to generate an ssh key and add it to your account
- Note: the ssh files are usually saved in
userName/.ssh
directory, it's usually a hidden directory.
- You can read more about encryption and ssh in Wikipedia here
Basic Workflow
- Using a command prompt or terminal
- Clone the repo with
git clone <url>
- Navigate your working directory to the git repo
- Fetch updates from the remote
git fetch
- Merge remote changes into your local
git pull
- Checkout a new branch
git checkout -b <branch name>
- Make changes