Do I need to do ‘git init’ before doing ‘git clone’ on a project

git clone is basically a combination of:

  • git init (create the local repository)
  • git remote add (add the URL to that repository)
  • git fetch (fetch all branches from that URL to your local repository)
  • git checkout (create all the files of the main branch in your working tree)

Therefore, no, you don’t have to do a git init, because it is already done by git clone.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)