简体   繁体   中英

how can i push my localhost project to github

Hello I want to use github but I have no clue how to use it. I read the tutorial but I still can't figure it out.

What I want is that i can push my project from my xampp localhost to github.

How can I do that?

Thanks for responding

You can create a new Repository : https://github.com/new

and

git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/yourPseudo/repositoryName.git
git push -u origin master

Assuming you use windows: You can install the following tool from Github-for-Windows . It is really easy to use and you can upload your local project easily with the tool set up.

@bouffe Basically said all you need to say.

I find it easier to create a repo in github first, check the box for "add a readme" and then once you have a page, just do a git clone in your local environment. That way you can just type in git clone https://github.com/yourPseudo/repositoryName.git which you can copy and paste.

That saves time. Also, if you use VS code you don't even need to do the commit -m anymore. Just save your changes and then click on the dev tools on the left and it will add and commit all new files. Makes it much easier.

Make sure you do a git checkout -b "dev" once you set up a repo. NEVER CODE ON THE MASTER.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM