English | 简体中文
A cli for simplifying git operations
[!TIP] If you use 0.2+, the lowest node version should be more than 18+.
npm install platano-git -g
yarn global add platano-git
pnpm add -g platano-git
* run platano -v
0.2.0+ or platano --version
to check whether to install package successfully
# View all local branches
platano br
# Push code to remote
platano ps
# Pull the latest remote code
platano pl
# Switch to main
platano ck main
Param | Description | Equal command | Remark |
---|---|---|---|
[branch] |
Switch branch | git checkout xxx |
If you input the branch, like platano ck main , it will switch to main . If you don't input anything (platano ck ), you will get a radio list which you can select the branch, click one then you will switch to that branch. |
-r |
Fetch remote branch when creating a new branch | It will only take effect when used with -b
|
|
-b [branch] |
Create new branch and switch to this branch | git checkout -b xxx yyy |
If you input the branch, like platano ck -b feat-xxx , then you select the base branch from rest branch list, it will create a new branch feat-xxx . If you don't input anything (platano ck -b ), it prompts you need input the new branch, select you base branch then you will create a new branch and switch to this branch. |
* The lowest supported git version is 2.23
Param | Description | Equal command | Remark | Example |
---|---|---|---|---|
|
Pull the latest remote code | git pull |
||
-s |
Select the remote end and pull the remote branch | git pull xxx yyy |
Param | Description | Equal command |
---|---|---|
|
Push code to origin, if current branch doesn't exists, it will create same remote branch | git push origin currentBranch |
-s |
Push code to remote branch, the default remote name is origin
|
git push xxx yyy |
-f |
Force push code | git push xxx yyy -f |
-u |
Push and associate remote branch | git push --set-upstream xxx yyy |
Param | Description | Equal command | Remark |
---|---|---|---|
[branch] |
Merge branch | git merge xxx |
If you input the branch, like platano mr feat-xxx , it will merge feat-xxx . If you don't input anything (platano mr ), you will get a radio list which you can select the branch, click one then you will merge that branch. |
If you encounter problems or have good ideas and suggestions, please report here.