14
Jun 2020
Getting and Creating Projects
$ git init -> Create an empty Git repository or reinitialize an existing one
After that current directory converted in git directory and .git file created in this directory.
An initial HEAD file that references the HEAD of the master branch is also created.
Start a new Git repository for an existing code base
$ cd /path-to-codebase
$ git init -> (Create a /path-to-codebase/.git directory)
$ git add . -> (Add all existing files to the index)
$ git commit -> (Record the pristine state as the first commit in the history)
$ git-clone - Clone a repository into a new directory
Clones a repository into a newly created directory, creates remote-tracking branches for each branch in the cloned repository
After the clone, a plain git fetch without arguments will update all the remote-tracking branches, and a git pull without arguments will in addition merge the remote master branch into the current master branch
$ git clone git://gi.example.com/linux.git