5

In my GitHub repository, I have many files and I have to change one of the words to another one. The problem is that, as the occurrences of that word is more than 200, I cannot change it one by one manually. Is there any way to facilitate this?

Lena
  • 350
  • 4
  • 13
Hami
  • 101
  • 2
  • 8
  • It seems strange that you need to update 200 files to change one word. You would almost certainly benefit from referencing a *single* file in this case with either an `include` or ` partial`. Then you would only need to update the one file, with the changes reflected in each of the 200 files. – Obsidian Age Nov 04 '19 at 23:11
  • 1
    The question title could be improved to include the fact that you're wanting to replace all instances across multiple files, in which case, we're looking at a very similar question to [this](https://stackoverflow.com/questions/37346481/how-do-i-find-and-replace-all-occurrences-in-all-files-in-visual-studio-code) - although I realise that you were looking for a git-specific solution (which, from the answers below, appears to not exist). – Luke Jul 12 '22 at 22:53

3 Answers3

5

In edit mode, press Ctrl + Shift + F, the editor will ask you: Replace, type the search word, then press Enter, the editor will ask you: With:, type the replacement word and press Enter. Then follow the menu.

Hossein
  • 113
  • 1
  • 6
2

The GitHub code editor appears to only allow for find and replace on one file at a time.

You would likely benefit greatly from the use of a code editor like Visual Studio Code which supports find and replace across all files in a project.

poltj18
  • 286
  • 2
  • 6
0

It is only possibly to find-replace within a single file in the GitHub browser editor.

On Windows, the shortcut is Ctrl + Shift + F. On macOS, the shortcut is Command + Opt + f.