Jason Lee
  • Home
  • Github
Sign in Subscribe

git

A collection of 2 posts
git

delete a file from git repository's history

有時候剛開發軟件的時候,會不小心把一些比較敏感的資料存進 GIT 裡面,例如: 密碼等等,即使我們把檔案刪除了,在 GIT 裡面的 history 也會看到,所以我們該如何徹底刪除呢? PS. 這邊只能用 bash 裡面的 git command 1 把Rakefile 改為你想刪除的檔案名稱 git filter-branch --force --index-filter \ 'git rm --cached --ignore-unmatch Rakefile' \ --prune-empty --tag-name-filter cat -- --all 2. push to git git push origin --force --all References: http://stackoverflow.com/questions/
May 15, 2016 1 min read
git

Microsoft TFS 轉 GIT

今天剛好把 TFS 版本控制轉移到 GIT 來 (包含全部過往的紀錄),順便筆記一下。 1. 我們是透過一個 open source工作來轉移 https://github.com/git-tfs/git-tfs 2. 首先先透過 choco 來下載 choco install gittfs 3. git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project ,當時讓我最不懂的地方是後面的 $/some_project,原本以為是本地端的路徑,經研究後才知道那是指 server 上 tfs 專案的位址,然後她會把項目,拷貝到當前目錄。 Reference: https://github.com/git-tfs/
Apr 20, 2016 1 min read
Page 1 of 1
Jason Lee © 2025
Powered by Ghost