發表文章

目前顯示的是有「git」標籤的文章

GitLab上git日常指令操作

圖片
  由於時常忘記所以還是做一下這塊的筆記 之前的筆記文章是從自己建立repository切入 淺談版本控制示意圖原理_作法_悲觀鎖定VS樂觀鎖定VS分散式版本_傳統Delta儲存.vs.DAG儲存 https://coolmandiary.blogspot.com/2017/05/vs.html 電腦環境上配置 git  config   --global   user.name  "你的名字" git  config  --global  user.email  "你的電子郵件" 列出目前電腦上git配置設定參數 git config --list  針對user name印出 git config user.name 針對email印出 git config user.email 通常起手式 要馬自己建立repository 要馬Clone(複製)別人的 Repository 這次先以比較常會碰到的 clone他人repository的情境來看 GitLab上分支 首先要針對自己的branch clone下來的操作 git clone --branch <branchname> <remote-repo-url> 或 git clone -b <branchname> <remote-repo-url> 假如有四個分支 git clone --branch {分支名稱1} https://XXXXXXXX.git git clone --branch {分支名稱2} https://XXXXXXXX.git git clone --branch {分支名稱3} https://XXXXXXXX.git git clone --branch {分支名稱4} https://XXXXXXXX.git 比方我要取我的分支下來做後續程式開發 git clone --branch KuanYu https://XXXXXXXX.git 接下來的操作都是當前已經切換到在含有.git目錄下的cmd或者linux環境目錄下的操作 status 指令 查看(初始確認) 通常都會確認目前checkout或者clone下...

Git取消已經被追蹤的檔案_Web.config

圖片
  每次都會不小心在commit時候把web.config  給commit跟push進來 當中包含了一些機密性資料 發信依賴的gmail帳號密碼跟DB連線字串帳密等等 真的還滿頭疼的>~< 後來都要頻繁去更新密碼 趕緊記錄起來不要再犯這類錯誤 開啟git bash 然後cd到專案目錄 可以直接到Web.config所在目錄 下這行指令使其不再被版控追蹤 git rm --cached web.config 記得把.config補加進.ignore Ref: .gitignore not ignoring web.config https://stackoverflow.com/questions/22038600/gitignore-not-ignoring-web-config How to change folder with git bash? https://stackoverflow.com/questions/8961334/how-to-change-folder-with-git-bash