Push Code to Github using Command Line (Terminal)

preview_player
Показать описание
How can we push code or files from local PC to github using command line? I am using windows operating system. For terminal program I have 'Git for Windows'. First of all you should be logged in to github and SSH keys from PC should be added to your github account so that communication from PC to github can be possible. Then create a new repository at github. Next page shows useful commands that can be used to push local files to Github.

Browse to your project directory in your PC. Open terminal or command line tool or terminal in the same directory.

Use following commands:
Initialize local directory as a git repository using:
git init

Add all files to local repository using:
git add .
Now files are staged for first commit

Check status and see all files staged for commit using:
git status

Commit files that are staged in local repository using:
git commit -m "First commit"

Specify remote repository url and add url for remote repository where local repository will be pushed using:
git remote add origin repo-url

Push the code in local repository to Github using:
git push -u origin master

See github repo page and your files will be there that are pushed.

Here are all the commands in sequence:

git init
git add .
git status
git commit -m "any comment here in quotes"
git remote add origin repo-url
git push -u origin master

- Git Clone, Add, Push Easy Way | Lazy Dev
- Use Git with Windows EASILY | Add, Commit, Push to Github via Graphical User Interface
- Git Commands Tutorial | Git Clone, Add, Commit, Push, Pull, Checkout, Branch, Status
- Learn Common Git Commands - Git clone, pull, add, commit, push, checkout

Thank You!
👍 LIKE VIDEO
👊 SUBSCRIBE
🔔 PRESS BELL ICON
✍️ COMMENT

#git #github #githubtutorial #webdevelopment #WebStylePress #code #softwaredevelopment #softwareengineering #programming
Рекомендации по теме
Комментарии
Автор

always indians producing them most easy and straightforward tutorials, why cant anyone else be like this?

unexpectediteminbaggingare
Автор

This has to be the best video for this online. Cheers mate!

tsaminamina_eheh
Автор

Thank you so much sir I stuck in for a while and like your video steps are very clear and informative thnks again

sayanchakraborty
Автор

Such a helpful video! Thank you SO MUCH!

amals.alzuhair
Автор

Thank you so much sir, I stuck in that problem for six hours, your video rescued me thanks a lot😊

sadafiqbal
Автор

This video really helped me to push my code to github. Thanks a lot.

sainaid
Автор

Thank you so much sir I stuck in for a while and like your video steps are very clear and informative thnks again

hackallworldjj
Автор

straightforward video, thanks man this video saved my time.

NOTHI.M
Автор

Thank you again very very helpful video

khalidpedia
Автор

This is a really helpful video. Do you have one on how to push changes that you have made so that they will load to the website for viewers that you share you site code with to be able to see the updates?

njlqtjb
Автор

Thank you so much! This was very helpful!

caitlinadegbite
Автор

When I hit enter after creating a repository, I don't get that next page he is on. Why am I not getting that page? Where do I go from here?

itsnobledean
Автор

This does not cover the confusing password requirements that github now has, with Personal Access Tokens

blahthebiste
Автор

Thank you Thank you Thank you much sir ❤❤❤❤❤❤

khalidpedia
Автор

How can I make any project inside repository live in GitHub?

areebahmed
Автор

Connecting local machine to Github through the SSH key none sense was the most important part that you just skipped!

amnn
Автор

Suppose I have written some new code into an existing file of the local repository. Then how can I push this new changes of the file(local) to the same previously uploaded git hub file.

sazzaduleanan
Автор

Hello, I need your help. Sorry if this is random but I would just like to know how this remote thingy works. I have master and develop branch, master as the first branch and develop (branched out from the master) and all features and other branches to be worked on as a team will start from the develop branch. What would be the origin in that case, is it master or should be the develop? I have set the origin to master btw and pushed this in github already.

marbles
Автор

Sorry, but I missed out on something. What did he mean by hit return after the "git push origin master" command???

harshitasingh
Автор

I think you forgot the git branch -M main command

cc-pupg