git提交代码到github上

打开git bash进入项目目录:

git提交代码到github上


然后将不需要提交的文件进行忽略:

touch .gitignore  创建.gitignore文件

在文件中把不需要的文件名或者文件输入进去

git提交代码到github上


接下来添加.gitignore文件中以外的文件

git add .

可以查看提交状态

git status


然后提交代码

git commit -m '输入提交内容'


然后将提交内容和远程仓库同步:后面为git仓库的地址

git remote add origin https://github.com/qblank/SpringSecurity.git

最后提交

git push -u origin master

此时需要添加github的用户名以及密码:

git提交代码到github上

这样就完成提交了

我们刷新下对应的github仓库的页面

git提交代码到github上