首次上传代码:
1、到有代码文件夹的文件夹下
2、git bush here
3、git config --global user.name "fxx"
4、git config --global user.email "xxxxxxxx@163.com"
//直接使用git init会报错,warning: LF will be replaced by CRLF in git/.gitignore.
//如果报错(rm -rf .git //删除,再进行后面的步骤)
5、git config --global core.autocrlf false
6、git init
7、git add .
8、git commit -m "first commit"
9、git remote add origin
https://xxxxxxxxxx.git
10、git push -u origin master
更新代码:
1、到有代码文件夹的文件夹下
2、git bush here
3、git add .
4、git commit -m "xxx"
5、git push
4、git commit -m "xxx"
5、git push
如果更新报错: Your branch is up-to-date with 'origin/master'.
1、git branch newbranch //创建新分支
2、git branch //检查新分支是否创建成功
3、git checkout newbranch //切换到新分支下
4、git add . //添加代码
5、git commit -m "second "
6、git status //检查是否成功
7、git checkout master //切换到主分支
8、git merge newbranch //将新分支改动的代码合并到主分支
9、git push -u origin master //push代码
10、git branch -D newbranch //最后还可以删除这个分支
来源: https://www.jianshu.com/p/e25c763b9816
2、git branch //检查新分支是否创建成功
3、git checkout newbranch //切换到新分支下
4、git add . //添加代码
5、git commit -m "second "
6、git status //检查是否成功
7、git checkout master //切换到主分支
8、git merge newbranch //将新分支改动的代码合并到主分支
9、git push -u origin master //push代码
10、git branch -D newbranch //最后还可以删除这个分支
来源: https://www.jianshu.com/p/e25c763b9816
链接新文件夹到仓库:
1、到有代码文件夹的文件夹下
2、git bush here
3、git config --global user.name "fxx"
4、git config --global user.email "xxxxxxxx@163.com"
5、git init
6、git branch 分支名
7、git checkout 分支名
8、git add .
9、git commit -m "commit"
10、git remote add origin
https://xxxxxxxxxx.git
11、git push -u origin 分支名