Git tutorial
Other useful tutorials: https://try.github.io/ https://www.atlassian.com/git/tutorials https://www.tutorialspoint.com/git/index.htm
Install your git
Make sure it works
$ git
- Open Terminal
- Set your GitHub username and email
$ git config --global user.name "rusucosmin" #change this to yours
$ git config --global user.email "[email protected]"
- Confirm that you have set the Git username and email correctly:
git config --global user.name
git config --global user.email
$ git clone https://github.com/dutylabs/git101
git checkout -b new-feature-branch
Open and modify index.html (add your name there).
# add all your changes
$ git add -A
# commit the changes
$ git commit -m "Added myself to the index.html page"
# get the latest changes from master
$ git pull origin master
# Push your changes
$ git push -u origin new-feature-branch
Open https://github.com/dutylabs/git101 in your browser
Your new branch should pop up at above the repo files
Click New pull request
After creating the pull request, ping someone from the team to review it and merge.
After the PR has been merged, it's time to go back to master.
# First, change to master
$ git checkout master
# Then, grab the latest changes from the repository
$ git pull origin master
# when you need to create another feature, go back to step 1.