git下载

安装使用
- 注意这两个勾上
 - 选择命令行运行模式
 - 其他默认
- 安装成功桌面鼠标右击有如下显示

使用
在gitlab创建一个项目

1. 创建项目时可能会提示没有秘钥,自己按照官网的步骤去操作生成(有问题留言)
2. 创建项目

将创建的项目地址复制下来

在本机上找个空目录使用鼠标右键打开 git bash here
- 直接git clone 复制的项目地址
- 示例:git clone http:1.1.1.1/项目名.git
- 将自己的项目全部copy到当前的目录下
- 上传到gitlab
- git add .(整个目录)
- git add 文件名(只上传单个文件)
- git commit -m “提交代码”
- git pull
- 创建远程分支
- 查看分支:
git branch -r - 从已有分支拉取新分支:
git checkout -b 分支名 - 运行上面的命令之后还是不会创建新分支,需要将本地的代码建立到远程仓库才可以
git push --set-upstream origin 分支名 - 提交代码到某个分支:
git push origin 分支名 --force
提交代码使用
- git add 文件名
- git commit -m “修改的内容注释”
- git push origin 分支名 --force
|