1

I have conf file that I want to keep some env(ip:port) infos in different branches. So, I want to commit this conf file to dev branch with the content of dev:port and to test branch test:port and master:port etc. After committed these branches, I want to untrack this file because of merges between branches. After some researches everybody suggests git rm -r --cached filename but it's unrelated with my issue. Any suggestion about that?

TL;DR:

A file that wants to keep in a repo but untracked.

Kerem
  • 840
  • 7
  • 22
  • "Tracking a file" is synonymous to "keeping a file in the repo". You should probably keep a general template config file in the repo, and do the environment specific stuff in the real config file which must stay untracked (e.g. must be in your gitignore). Consider this: https://stackoverflow.com/a/4744071/10470287 – alfunx Jul 12 '19 at 11:54
  • `--assume-unchanged` I also tried this feaure. This is working only locally. Actually, `--assume-unchanged` feautre what I want but origin side not locally. – Kerem Jul 12 '19 at 12:09

1 Answers1

0

Try this one (more info here)

git update-index --skip-worktree <path-name>
Yura
  • 2,925
  • 2
  • 18
  • 27
  • Also tried this one. It didn't work out. This one is also for locally usage. We just tried one of my colleague pc again. He can be add smth to file and commit :/ – Kerem Jul 12 '19 at 12:39