Follow along with your own computer!
We’re going to now work as a groups. Find two other people and practice commiting, pushing, and pulling.
git add – adds a file to the tracked files and stages it for commit
- Common use - git add “file.py” or git add * (To add everything)
git status – shows you the current status of your repository (like changed / added / deleted files)
git log – shows you the n last commit messages with some other data
git commit – it will “save” current state of files locally, and prepare them for git push
- Common use - git commit -m ‘Commit Message’ or git commit -am ‘Commit Messge’
git push – it will collect all of your current commits that havent been commited and push them to remote repository
- Common use - Git push origin master
git pull – combination of git fetch and git merge
- Common use - Git pull origin master
git fetch – it fetches the remote changes to your local repository, but it doesn’t change your current source contents
git merge – it’s used for merging 2 branches into one, if theres no need for 2 anymore
git branch <new-branch-name> – creates a branch with name “new-branch-name”
git diff – if you fetch the changes from remote, you can then see the difference between your code current version and last one on remote