Setting up Git with Webstorm and Bitbucket
-
Install Git download from here.
Make sure that the git is in environment variables by using command prompt. If not, add paths in environment variables according to installation location of git, such as given below. NOTE: your location may be different than mine (C:\Program Files\Git).
|
C:\Program Files\Git\bin
C:\Program Files\Git\cmd
|
If you have done #2 successfully then when you type git in a command window you will see the following:
-
Take Existing Project and associate with a new LOCAL Git repository
- Open the project that you want to put under Git.
- From the main menu, choose VCS | Enable Git Integration OR Enable VC ControlIntegration
- In the dialog that opens, select Git from the drop-down list and click OK.
Git does not support external paths, so if you choose a directory that is outside your project root, make sure that the folder where the repository is going to be created also contains the project root.
- From the main menu, choose VCS | Import into Version Control | Create Git Repository.
- In the dialog that opens, specify the directory where a new Git repository will be created.
-
Add files to the local repository
You can also add files to your local Git repository from the Project tool window. Select the files you want to add, choose Git | Add from the context menu.
-
Commit files you added to local repository
VCS->Commit
....now add messages, author etc as you wish and push the changes by selecting COMMIT AND PUSH
-
Add remote repository (you must have already created one on BitBucket or GitHub)
VCS->Git->Remotes
AND then add with + a new repository --it will ask for you URL and later you password
-
Any time you want to commit and push: VCS->Commit then select what you want and push
here you can see the results of pushing it on the remote repository I have on BitBucket
Now I am going to add a gitHub resgistry rather than a BitBucket one
VCS->Import into Version Control->Share Project on GitHub (assumes you already have an account on github)
Now I will commit in WebStorm and it will commit to this new remote repository
© Lynne Grewe