Windows Git

Summary

In HBuilderX, you have to install the Git plug-in before you can use Git.

The Git plug-in calls the external Git command line tool, you need to install TortoiseGit

TortoiseGit DownLoad

Install TortoiseGit

TortoiseGit Download, double click exe file after download and then follow the instructions to complete the installation.

Note:TortoiseGit is available in 32-bit and 64-bit, please download right file according to your computer OS.

After download TortoiseGit, double-click to open it to install it.

Windows Git - 图1

Windows Git - 图2

After the installation is complete, right-click the mouse and the TortoiseGit menu will appear, as shown below:

Windows Git - 图3

Install Git Plugin

HBuilderX Top menu, [Tool]-> [plug-in installation]. Open the plug-in installation window, Find Git, Click [Install].

Windows Git - 图4

Clone or Import

  • Top Menu, [File]-> [Import]-> [Import From Git]
  • HBuilderX Project manager, Right click menu [Import]-> [Import From Git]

Windows Git - 图5

Git menu

In the project manager, select the project and right-click the menu to see the git related operation menu. Click the related menu to bring up TortoiseGit.

Note: HBuilderX Git plug-in calls TortoiseGit for all git operation, please search TortoiseGit manual for more details.

Windows Git - 图6

Pull

git-pull - In explorer, select a project and right-click mouse, then click [Git Pull] from menus.

Windows Git - 图7

Push

git-push - In explorer, select a project and right-click mouse, then click [Git Push] from menus.

Windows Git - 图8

Remark:git push —force: It means to push the current code library of your own computer to the remote server and overwrite it. Please use it with caution.

Shortcut Configuration

  1. Top menu, 【Tool】—>【Custom Keybindings】
  2. All Git command configurations can be seen at the bottom of the left side of the document
  1. //git pull
  2. //{"key":"","command":"ExternalCommand:GIT_PULL"},
  3. //git commit
  4. //{"key":"","command":"ExternalCommand:GIT_COMMIT"},
  5. //git push
  6. //{"key":"","command":"ExternalCommand:GIT_PUSH"},
  7. //git rm file
  8. //{"key":"","command":"ExternalCommand:GIT_REMOVE"},
  9. //git add filename
  10. //{"key":"","command":"ExternalCommand:GIT_ADD"},
  11. //git switch branch
  12. //{"key":"","command":"ExternalCommand:GIT_CHECKOUT_BRANCH"},
  13. //git status
  14. //{"key":"","command":"ExternalCommand:GIT_STATUS"},
  15. //git reset
  16. //{"key":"","command":"ExternalCommand:GIT_RESET"}

Select the required command and copy it to the right, configure your own shortcut keys

Example:

  1. [
  2. {"key":"command+alt+u","command":"ExternalCommand:GIT_PULL"},
  3. {"key":"command+i","command":"ExternalCommand:GIT_COMMIT"}
  4. ]