Faruk CEBECI
According to Cambridge Dictionary, version is:
a particular form of something that is slightly different from other forms of the same thing
Version control system is a system that keeps track of different versions of something.
.git
We can create an empty repository with the following commands:
$ mkdir repo $ cd repo $ git init
We can check the status of the repository with the following command:
$ git status
$ git diff
We can make changes on the repository with the following commands:
$ echo "Hello world" > hello.txt $ git status
In order to specify the changes we made, we use the staging area.
$ git add hello.txt
$ git reset hello.txt
$ git commit -m "Add hello.txt"
-m
$ git log
$ git remote add origin <url>
$ git push -u origin master
We can pull the commits from the remote repository with the following command:
$ git pull origin master # or $ git fetch origin master
$ git branch <branch-name>
$ git checkout <branch-name> # or $ git switch <branch-name>
$ git checkout -b <branch-name>
.git ├── COMMIT_EDITMSG The commit message in raw format ├── HEAD HEAD points to the current branch (ref: refs/heads/master) ├── config git configs specific to this repository ├── description Description of the project ├── hooks Scripts that are run before or after certain git commands │ └── ...shell scripts... ├── index The staging area ├── info Auxiliary files │ └── exclude Exclude patterns (.gitignore) ├── objects All the objects in a compressed format (with their hashes as filenames) │ ├── info Stores │ ├── pack All the objects in a compressed format │ └── 00 All the objects whose hash starts with 00 │ └── ...rest of the hash... Object file (compressed) └── refs References to commits. They are pointers. (branches, tags, etc.) ├── heads Last commit's hash for each branch ├── tags Commit hashes for each tag ├── stash Stash commits └── remotes Last commit's hash for each remote branch