- Untracked
- Unmodified
- Modified
- Staged
- Committed
Remember that the changes to files you have made on your local machine are not on on the central repository until you push them.
git init
initialize tracking of a file
git status
check the git status of a directory/file
git add
add file to track/push to the staging area
git diff
see the modifications made to a file
git commit -m "Message"
commit changed from the staging area
- git innit (to initialize a repository of the current directory)
- git add file_name.extension (stages the file)
- git commit -m "Simple message of changes" (submits the file or files from the staging area to the repository)
- git push (sends all commit(s) to the central repository)
Forking is the process of creating a copy of a repository on Github from a different source. Cloning is the process of downloading a copy of the code that exists in a specific web address.
Running git status
can will tell you what files you have modified. The results look something like this:
/git_and_gh_practice[master !]$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: travels.txt
no changes added to commit (use "git add" and/or "git commit -a")
git_and_gh_practice[master !]$