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