学会提交代码到gitlab线上仓库。

来源:互联网 发布:小智logo软件 编辑:程序博客网 时间:2024/06/06 01:18

1.切换git bash的目录:找到项目文件夹右键有git bash here;


2.登陆: git config --global user.email "you@example.com"
git config --global user.name "Your Name"
这个email和name后面有个空格要注意。

3.git status:查看仓库的状态。

4.git add <file>:将文件加入缓存区中;

5.git status:查询是否加入成功;

6.git commit -m "":只会提交添加到缓存区的文件到本地仓库;
或者git commit -a -m "":能提交修改过但没有添加到缓存区的文件

7.git log:git log  能查看提交历史,后面加上  --pretty=oneline  能使内容单行显示;

8.git push origin master:将本地仓库的文件上传到线上仓库;

2和3之间插入
git clone '你的网上仓库地址';

这里一个粘贴的小技巧:shift+insert:粘贴,ctrl + insert:复制;

原创粉丝点击