search

Home  >  Q&A  >  body text

How can git submit a file only once, and then no changes to the file will be submitted, and all branches will take effect?

There is a configuration file
Save a releasable state on git
But local testing requires changes to the configuration file
These changes do not want to be submitted to git
Previous practices
git update-index --assume-unchanged
Let the files not be tracked locally
But this approach has no effect on other branches

Is there any command that can achieve the effect I want?

世界只因有你世界只因有你2771 days ago1034

reply all(2)I'll reply

  • 为情所困

    为情所困2017-05-02 09:28:51

    git-extras provides a command git lock to implement this function. After submitting the file, use the git lock command to lock the configuration file.

    Of course, the implementation of this git lock command is very simple, packaging the functions that come with git:

    git update-index --skip-worktree 文件路径
    

    Has the same effect.

    reply
    0
  • 迷茫

    迷茫2017-05-02 09:28:51

    I don’t know if the .gitignore file is satisfactory. After submitting it once, fill in the configuration file and add it to the .gitignore file, and it will not be submitted again

    reply
    0
  • Cancelreply