MacOSX Git Manual
Summary
In HBuilderX, you have to install the Git plug-in before you can use Git.
HBuilderX Top menu, [Tool]-> [plug-in installation]. Open the plug-in installation window, Find Git, Click [Install].
clone and import project
- Top Menu, [File]-> [Import]-> [Import From Git]
- HBuilderX Project manager, Right click menu [Import]-> [Import From Git]
Git menu
In the project manager, select the project and right-click the menu to see the git related operation menu.
Pull
git-pull - In explorer, select a project and right-click mouse, then click [Git Pull] from menus.
Push
git-push - In explorer, select a project and right-click mouse, then click [Git Push] from menus.
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.
Commit
- Select the file or the directory or the project to be submitted, right-click the menu and click [Git Commit]
- In the pop-up window, enter the
commit message
and click the [Commit] button.
View Log
Selected Project,right-click menu [Git]->[View Log]
Branch
- New Branch: Selected Project, right-click menu【Git】-> 【Git New Branch】
- Switch Branch:Selected Project, right-click menu【Git】-> 【Git Switch Branch-Checkoutf】
- Delete Branch:Selected Project, right-click menu【Git】-> 【Git Delete Branch】
- Merge Bbranch:Selected Project, right-click menu【Git】-> 【Git Merge Branch】
Shortcut Configuration
- Top menu, 【Tool】—>【Custom Keybindings】
- All Git command configurations can be seen at the bottom of the left side of the document
//git pull
//{"key":"","command":"ExternalCommand:GIT_PULL"},
//git push
//{"key":"","command":"ExternalCommand:GIT_PUSH"},
//git rm file
//{"key":"","command":"ExternalCommand:GIT_REMOVE"},
//git add File
//{"key":"","command":"ExternalCommand:GIT_ADD"},
//git switch branch
//{"key":"","command":"ExternalCommand:GIT_CHECKOUT_BRANCH"},
//git status
//{"key":"","command":"ExternalCommand:GIT_STATUS"},
//git reset
//{"key":"","command":"ExternalCommand:GIT_RESET"}
Select the required command and copy it to the right, configure your own shortcut keys
Example:
[
{"key":"command+alt+u","command":"ExternalCommand:GIT_PULL"}
]
Q:git xcrun error
Error encountered when using git:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Solution, open the terminal and enter the following command:
xcode-select --install