Ernesto Flames
Ernesto Flames

Reputation: 27

How to include files in my Git commit with PHPStorm?

Reworded question:

I use the PHPStorm IDE. During my development process I add images for testing purposes. I want to include them in my commits, so other team members can see and pull them from the repo. How do I do that? Can I configure PHPStorm to do that for me?

Original question:

phpstorm vcs (GIT) dont upload images First of all, sorry for my English. I will try to do my best. :D

I want to know how can i configure PHPStorm to upload the images in every commit (git)... Like Sourcetree does.

For example, if i have a gallery module in my app and i upload some image to test, when i make a commit for my team they cant see the image because phpstorm does not uploaded it. Atlassian Sourcetree does but i want to use the built in VCS from PHPStorm..

Upvotes: 0

Views: 2105

Answers (2)

Ernesto Flames
Ernesto Flames

Reputation: 27

Version 9 does.. Problem solved!

Upvotes: 0

Nick Volynkin
Nick Volynkin

Reputation: 15089

Why I think there's no configuration needed.

PHPStorm and any other IDE is just a tool to manage your git repo. You can work with the same repo from IDE, any GUI-tool and command-line simultaneously. Your question seems to be about Git and not about IDE configuration.

What one can and can't add to a commit.

Second, Git can only work with files that are in the directory, where you've initiated a Git repo. Usually it's your project's root directory. If you add your images to a directory somewhere in your project - you can add them to commit. If they are somewhere else, you'll have to download them and put somewhere in the project. I could not understand that clearly from your question.

Just tell me how to add my files!

Now, when the files are somewhere in your project folder, you can add them:

  1. From PHPStorm. Pick the file, menu [VCS] >> [Git] >> [Add]
  2. From the console. Press Alt+F12 to open the console. Then

git status to see lists of files (1) changed and staged for commit (2) changed but not staged, (3) not tracked yet. Any list may be empty.

git add full/path/to/file.png to add the files to next commit

git commit -m'commit message' or your usual way to commit files from IDE menu

Please reply whether it helps or not.

Upvotes: 1

Related Questions