今天開會時提到,git儲存檔案的方式在這裡有比較詳盡的說明:Every version of a file in Git is represented as a whole, with its own blob containing the file's complete contents. A fundamental design element of Git is that the object store uses content-based addressing. blob存的是整個檔案,但是它是 content-based addressing、也就是說,相同的檔案內容只會被儲存一次。當前的檔案,如果有在之前的commit被儲存下來且沒有異動,那將不會儲存、而是指向先前commit時,該檔產生的SHA1 ID referencehttp://chimera.labs.oreilly.com/books/1230000000561/ch01.html#_object_ids_and_sha_1The usefulness of hash-based object identifiers in Git depends on treating the SHA-1 hash of an object as unique; we assume that if two objects have the same SHA-1 fingerprint, then they are in fact the same object. From this property flow a number of key points:Single-instance store......
- switch to your working directory
- git init
- git add .
- use 'git status' to confirm the status
- git commit -m "init"
- use 'git status' to confirm the status
- switch to the dropbox folder, ex: cd ~/Dropbox/repos
- make a remote repo: mkdir _repositoryName.git
- git init --bare _repositoryName.git
- switch to your working directory
- git remote add origin _repositoryPath, ex: /home/erica/Dropbox/repos/repositoryName.git
- git push origin master
and if you want to checkout the project: git clone _repositoryPath _projectname