Git & GitHub
CS50W Lecture 1 Notes
Summary
Git has given us the ability to keep track of any changes we make to code and to work with other people on it such that we can be working on multiple parts of the same project, and someone else working on the same project can also be working on multiple parts of the same project on different branches.
Git bash basic commands
git clone https://github.com/mj-boruto/blog.git
git status
git add file_name
git add folder_name // add all files in that folder
git commit -am "message" //add all the files that has been changed in this directory and commit
git add file_name
git commit --amend (--no-edit) //update
git push
git log
git reset
git reset --hard <commmit>
git reset --hard origin/master
git pull
Branching
git branch
git checkout -b new_branch_name
git checkout branch_name
git merge branch_name
Merge Conflicts
- get rid of the commit markers
- modify the file
- commit and push