Git Bash :
git clone https://xxx/test.git #克隆项目
git checkout -b branch_name # 创建新的分支
git add . # 改一顿之后提交所有修改
git status # 查看当前所有修改的文件状态
git checkout xxx # 取消某个文件的修改
git commit -m ‘xxx’ # 提交commit信息
git push origin branch_name:branch_name # 推送到远程仓库,:前后分别是本地分支名:远程仓库分支名
git pull origin master # 合并远程仓库的代码
GitLab :
今天添加了谷歌两步验证,所以要求clone的时候必须使用Access Token才能使用,Access Token在GitLab账户设置中可以生成,生成完了之后这样使用:
git clone https://oauth2:Access_Token@xxx/test.git
参考这篇文章:
https://stackoverflow.com/questions/25409700/using-gitlab-token-to-clone-without-authentication