Codementor Events

How to setup a git repository

Published Jan 01, 2018Last updated Oct 02, 2018
How to setup a git repository

Configure Git for the first time

git config --global user.name "name"`
git config --global user.email "email"

Clone the existing repository

git clone <git-url>

If your code is ready to push

cd existing project
git init
git add --all
git commit -m "Initial Commit"
git remote add origin https://username@github.com/reponame.git
git push -u origin master

If your code is already tracked by Git

cd existing-project
git remote set -url https://username@github.com/reponame.git
git puhs -u origin master
Discover and read more posts from Santhosh D
get started
post commentsBe the first to share your opinion
Show more replies