Git Flashcards
Modified
there’s been changes to the file but it’s not committed yet
Staged
You have marked a file to go into your next commit snapshot
Committed
the changes you made have been stored locally
workflow
- Modify the files
- Stage the files
- Do a commit
- Push Up to Github
~ git status ~
tells you the current state of the project
~ git add ~
adds a file to now be tracked by git
git “staging area”
where files are before they get committed to the repository. They can be added or deleted before they get to the repository
~git commit~
committing the files from the staging area to the repository
~git log~
lists all the changes that you’ve committed so far
~git remote add origin ‘your Github account’~
adding a commit to be pushed
~git push~
push the changes
~git pull~
pulls any changes done in the main repository to our local repository
~git diff~
tells you what is different in commit
variations:
1. git diff HEAD: changes in your most recent commit
2. git diff –staged: to see the changes you just staged
~git reset ‘file name’~
un-stage files
~git checkout ‘file name’~
files can be changed back to how they were at the last commit