简体   繁体   中英

How to upload a full-stack (ReactJS , NodeJS , socketIO) project to github by git bash command line

I have just built a project about realtime chat , now I just want to upload it to the github reposity my folder structure look like this enter image description here

I don't know how to upload the whole project to github by git bash command line

I have read the github docs , but I just can only upload 1 folder per time (just "client" or "server" folder per time) , can someone show me how to upload the whole folder (the "chat-app" folder) to github?

  • First, be sure that your gitignore contains the following :

/node_modules

It will prevent git from uploading node_module (which you can easily recreate with npm install ).

  • Then you can do a git init in your folder (chat-app). It will create a new local Git repository .

you can then use the full power of git in this folder.

  • Then you have to add modificated files to stage . many possibilities here some uses git add . or git add -A or you can do it file by file git add [filename] (Without brackets)

  • After that you can commit your modification with a message to tell what modifications you made : git commit -m "my super commit message"

  • You also have to specify git a remote repository git remote add [name] [url] (for exemple : git remote add github http://github.com/myUsername/myRepo.git

  • And finally you can push your modification : git push [remoteName] [remoteBranch] ( git push github 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