Frage

I use phpstorm as my IDE, it has git version control integration built in so I have never needed to use the command line.

However I have run into a problem, a few times when I have been prompted "Do you wish to add this file/directory to git version control" I have clicked no, Hence I have some folders and files all over the place that are not under the control.

I am wondering if there is a command I can run that will add all these files to the version control for me?

War es hilfreich?

Lösung

Get to a command line and change your working directory to your git repository.

$ cd /home/wesley/dev/mytwitterbook

Stage everything in the working directory and subdirectories

$ git add .

The next time you commit, everything that has not been .gitignore'd will be added to version control.


NB: git add . will also stage any files that are already version controlled. If you've made changes to any files since your last commit, you may want to avoid committing them. If so, stash your changes first:

$ git stash  # set aside any changes in VC'd files
$ git add .
$ git stash pop  # restore stashed changes

Andere Tipps

In PhpStorm you can open the Changes panel and in the Local tab you will see all the Unversioned files under the separate node. You can right click on this node or select individual files and then add them to version control at once. Then perform commit/push when ready.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top