2014年3月3日

[訊真科技技術園地] GIT儲存檔案的方式:Git Pocket Guide




今天開會時提到,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 reference
詳參:
http://chimera.labs.oreilly.com/books/1230000000561/ch01.html#_object_ids_and_sha_1
--
The 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......

|
|
|
ˇ
如何利用Dropbox將專案納入GIT版本控制

  1. switch to your working directory
  2. git init
  3. git add .
  4. use 'git status' to confirm the status
  5. git commit -m "init"
  6. use 'git status' to confirm the status
  7. switch to the dropbox folder, ex: cd ~/Dropbox/repos
  8. make a remote repo: mkdir _repositoryName.git
  9. git init --bare _repositoryName.git
  10. switch to your working directory
  11. git remote add origin _repositoryPath, ex: /home/erica/Dropbox/repos/repositoryName.git
  12. git push origin master
and if you want to checkout the project: git clone _repositoryPath _projectname