Git初始化与上传

一:

现在git上Create个repository

二:
进入要长传的工程目录
打开git bash

git init
git status
git add .
//add .的时候文件不要被占用。


git commit -m "first commit"
git remote add origin https://github.com/XXX/YYY.git


git push -u origin master
//会弹出让输入账号密码

//上面一二操作在git上创建了个新项目。

三:
平时更新或上传

git pull origin master
git push origin master


2,更新添加文件:
$ git status


Windows使用回车和换行两个字符来结束一行,而Mac和Linux只使用换行一个字符。
Git可以在你提交时自动地把行结束符CRLF转换成LF,而在签出代码时把LF转换成CRLF。
可以设置false取消此功能,把回车符记录在库中



$ git add .

$ git commit -m "setRole"
$ git push origin master

posted @ 2016-07-19 01:50  细雨细语  阅读(4387)  评论(0编辑  收藏  举报