Ha Khanh Nguyen (hknguyen)
|- delta-based version control||- a stream of snapshots|
|- requires connection to databases or other computers on the network to access certain files||- everything is stored locally|
|- allow limited operations without server connection||- nearly every operation can be done locally|
Git has three main states that your files can reside in: modified, staged, and committed:
This leads us to the three main sections of a Git project: the working tree/directory, the staging area, and the Git directory.
clonean existing Git repository from elsewhere. (this is what you have been doing with the labs)
# macOS cd Desktop/stat430/my-project # Windows cd Desktop/stat430/my-project
.gitthat contains all of your necessary repository file.
git add -A git commit -m "initial project version"
git remote add origin <your repo URL here> git push origin master
git clone <url>
test.mdto this directory:
test.mdfile and ALL other new files, you can run this:
git add -A
test.mdfile, you can instead run the following command:
git add test.md
git statusagain to see if the status changes.
hw1-soln.ipynbfile appears under a section named “Changes not staged for commit” — which means that a file that is tracked has been modified in the working directory but not yet staged.
git addcommand is a multipurpose command: it can be used to begin tracking new files, stage files and other things.
hw1-soln.ipynbfile, then run
hw1-soln.ipynbto make another change!
hw1-soln.ipynbis in both "Changes to be committed" and "Changes not staged for commit"!
git add, you have to run
git addagain to stage the latest version of the file!
git addon since you edited them — won’t go into this commit.
git commit -m "add test.md + changes hw1-soln"
-mflag is to indicate that the included string is the commit message.
git push origin master
This lecture notes referenced materials in 1.3, 2.1 and 2.2 sections of Pro Git by Scott Chacon and Ben Straub.