Pushing your local project to remote repository in GitHub using Command line
Step 1: Check whether git is installed in your system or not.
How to check 🤔. Is this your question answer is simple.
Open command line/terminal ----> git ----> if after entering git of it won't show any error then you can say git is installed in your system.
Step 2: Open your github account and create a new repository in your github .
Top right corner ----> click on + or add ---> Choose new repository ---> give permissions only which are needed ----> Click create
Wohoo! Done creating a new repository in remote.
Step 3: Now our task is to connect our local repository to remote repository (GitHub repository) . Follow the below series of steps
Open cmd line / terminal ----> Go to your local project path ---> git init ---> git remote add origin https://(repo_name)
Note:: repo_name is accessible from your github repository on choosing thr repository which we have created copy and paste here.
Now you have connected your local project to remote github repository project.
Step 4: Connecting our local branch to remote branch
git branch -M main
If you get any errors do not worry that branch is already existed. Go ahead with the next command
Step5: Pushing our local branch to remote branch
git push -u origin main
This doesn't work then try something like
git push --set-upstream origin master
The one good thing about command line in git is it always suggests you the proper command. That's the specialty of git in command line/terminal.
That repo link is mine update with your project repo link😅 dear.
It won't end our task now.
Now we need to commit and push our changes in our project right
First Check the changes in your project
git status
git add .
git commit -m "message"
git push
Wohooo🎉 we have done pushing our project to remote















