How to create/initialize git repository from local project or file structure


create files if not exist in the local drive 

> git init #this will initialize a git repo , we can see by the .git file been created 


then stage the changes made on the local repo by

> git add .

> git commit -m "First commit"


then create a new repo in github/gitlab

then copy the url and issue the command 

> git remote add origin <url of the new git repo>

> git push origin master


To run the short command "git push" we need to issue the command 

>git push --set-upstream origin master 


then we can push with 

> git push 



Comments

Popular posts from this blog