Zi 字媒體
2017-07-25T20:27:27+00:00
上傳檔案至gitlab基本命令
git config --global user.name "XXXX"
git config --global user.email "XXXXX"
cd #移動到你的目標資料夾
git init #初始化當前資料夾變成git的倉庫
git remote add origin git@XXXXXXXXXXXX.git #重新設定
git remote set-url origin git@XXXXXXXXXXXX.git #重新設定git_link
$ git add file_name #選擇你想上傳的檔案
$ git commit -m "description" #提交檔案描述
$ git push -u origin #將變更資料上傳並更新gitlab倉庫
--------------------------------------------------------------------------
git reset HEAD^ --hard #檔案回到上一次 commit的狀態,而且取消剛剛的 commit
git revert HEAD^ --hard git add . #將所有檔案上傳
git branch #創建分支
git branch -a #查看所有分支
git checkout #切換分支
git rm --cached #指定某個檔案不受gitlab控制
git filter-branch --tree-filter "rm -f file_name.xml" #強制移除gitlab內的檔案
git pull --rebase origin #將gitlab上的資料同步你本機端資料夾
如果想上傳整個資料夾該如何做呢?
後續作法跟上述命令一樣
寫了
5860316篇文章,獲得
23313次喜歡