網頁

2023年11月30日 星期四

How to use TFS / GIT at same folder. 在同一個資料夾使用TFS和GIT.

If you still use the TFS. And want to connect same folder to GIT repository.
Git can work correctly. 
But when you opne Visual Studio. VS alert just support one version control at same time.
Below is my way:
  1. On Windows and use Git Bash.
  2. Your source folder already connect to TFS.
    • Example: /temp/source1/
  3. Source folder connect to new local GIT. (separate .git to another folder)
    • git init --separate-git-dir ../source1_git_repo
    • Now can see two folders in /temp/
      • /temp/source1/
      • /temp/source1_git_repo
    • Check .git just a folder path:
      • cat .git
      • gitdir: C:/Users/YouName/AppData/Local/Temp/test/source_git_repo
  4. Currently Git is work.
  5. How to use TFS for now? Just rename .git 
    • mv .git to .gitrepo (rename)

沒有留言: