Merging projects is nearly impossible without Git so let’s get it up and running and then learn the basics.
OSX
Install Homebrew if you don’t already have it by running ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” in the terminal
Install git with the command brew install git
Linux
Windows
Confirm your git installation with git –version
Now that you’ve got git installed you need to configure it to work with your GitHub. If you don’t already have a GitHub account you can sign up for one here.
Configure your username and email with the following commands.
The first step to working with Git is to create a repository. You can create a repository on the GitHub webpage by navigating to the repository page and hitting the “New” button, or you can create a new directory and use the command git init.
If someone else has already created a repository as is often the case you can “clone” the repository to your machine using the command git clone followed by the https address that is associated with a given repositroy. The https address associated with a repo can be found in the top right corner of a repository page as shown in the picture below.
Now that you’ve got a repository setup you can make changes to the project using the following commands.
git add
It’s quite likely that you’ll encounter merge conflicts while working with Git on a regular basis, and while they can be quite frustrating they are not that difficult to fix.
Update your repo using git pull
Try to merge your changes using the git merge
Use git add and then git merge to try and merge your changes
If you’re still getting errors go back to step 1