用webstorm上传代码时,首先要先下载git,网址一搜就可以搜到,然后开始配置webstorm,打开webstorm,在file-settings中直接搜索github,然后输入自己github的账号密码,

点击test,之后就会出来了 connection successful的提示框,说明已经可以连接到你的github账户了。
连接成功之后还需要连接下载的git,还是直接在settings中查找git,将git的安装路径输入,点击text,成功之后也会出来个connection successful的提示框,一般只要是看到successful就是没有什么问题了。只要不是提示什么fail啊,error的就继续往下一步吧!

之后需要获取本地的ssh,复制到github账户中的ssh中,SSH的作用是让本地版本库与远程版本库通信,也就是你在本地修改好的代码,需要同步到服务器上的时候,就需要这个SSH密钥来通讯。首先获取本地git ssh,打开git bash,输入ssh-keygen -t rsa -C “你的邮箱”,我输入的时候发现没办法复制只能一个一个的敲上去了,记住输入完之后需要按三次回车,才能出现c:users(用户)xxx(用户名).ssh的文件,打开找到id_rsa.pub的文件,可以用记事本打开

like this:

然后复制里面的内容,打开自己的github账户,找到settings-ssh and GPGkey,打开之后点击右上角new ssh key,将复制的ssh粘贴即可。

准备工作做好之后就可以上传代码啦,打开webstorm,如图

点击之后会弹出来这样的页面

将你想要上传的代码选择github中的一个文件夹,写好自己的github地址,在本地文件中选择好上传代码的路径,在这里需要注意的是,如果你要上传文件的目录中,已经存在了同名目录,比如f: ask,这样的话是不能拷贝到github中的,如果有冲突的话直接换个文件夹的路径就好了。
点击想要上传的代码或者是文件,

add之后会发现原来红色的文件名变为了蓝色((⊙o⊙)或者是绿色没办法蓝绿不分啊 啊啊),

点击vcs中的commit changes,出来这个页面

按照提示点击commit and push,去github主页上查看,代码就上传好啦~~~