Case 1:
In order to clone existing git project:
git init
git remote add origin <remote path to .git>
echo “Sandeep G” >> contributors.txt
git add contributors.txt
git commit -m ‘Initial commit with contributors’
git push -u origin master
Case 2:
In order to clone existing local project to git:
cd /path/to/my/repo
git init
git add folder1 folder2
git commit -m ‘Initial commit with contributors’
git remote add origin <remote path to .git>
git push -u origin –all # pushes up the repo and its refs for the first time
git push -u origin –tags # pushes up any tags
Possible git errors:
Error 1: The file will have its original line endings in your working directory.
Solution: git config core.autocrlf true
