#Intro to Git
Install Git and a text editor of your choice
- Fork the repository by pressing the "fork" button. This creates a copy of the repository under your account.
- Enter the new repository you forked. Click "clone or download" and copy the "Clone with HTTPS" link
- Open git bash and use cd to where you want to store your Git repositories
- Type into the terminal
git clone {insert-url-here}
(remove the curly brackets) - use
cd {name-of-folder}
to move into the directory you just created andls
to see what folders/files are in your current working directory - Create a new branch
git checkout -b "name-of-branch"
- Make edits to the index.html file
- Add and commit the change using
git add .
andgit commit -m "description of commit"
- Switch to master
git checkout master
- Merge your new branch to master
git merge name-of-branch
- Make a change on the master branch, then add and commit
- Switch to your other branch and make a different change on the same line
- Add and commit these changes on your other branch
git add .
git commit -m "description of commit"
- Switch back to master and merge
git checkout master
git merge name-of-branch
. This will create a merge conflict. - Fix merge conflicts
- Add, commit, and push
git push origin master
(push updates the remote repository on Github)