@sebastienrousseau/dotfiles 0.2.440 → 0.2.452
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COPYRIGHT +5 -0
- package/LICENSE +1260 -2
- package/Makefile +79 -0
- package/README.md +328 -71
- package/bin/dotfiles.sh +150 -0
- package/index.js +24 -0
- package/package.json +99 -25
- package/pnpm-lock.yaml +178 -0
- package/pnpm-workspace.yaml +2 -0
- package/shell/README.md +3 -0
- package/shell/aliases/README.md +327 -0
- package/{Icon/r → shell/aliases/default/README.md} +0 -0
- package/shell/aliases/default/default.aliases.sh +199 -0
- package/shell/aliases/gcloud/README.md +117 -0
- package/shell/aliases/gcloud/gcloud.aliases.sh +121 -0
- package/shell/aliases/git/README.md +279 -0
- package/shell/aliases/git/git.aliases.wip +586 -0
- package/shell/aliases/heroku/README.md +457 -0
- package/shell/aliases/heroku/heroku.aliases.sh +1031 -0
- package/shell/aliases/jekyll/README.md +32 -0
- package/shell/aliases/jekyll/jekyll.aliases.sh +50 -0
- package/shell/aliases/pnpm/README.md +3 -0
- package/shell/aliases/pnpm/pnpm.aliases.sh +42 -0
- package/shell/aliases/subversion/README.md +54 -0
- package/shell/aliases/subversion/subversion.aliases.sh +123 -0
- package/shell/aliases/tmux/README.md +0 -0
- package/shell/aliases/tmux/tmux.aliases.sh +14 -0
- package/shell/aliases.sh +12 -0
- package/shell/configurations/README.md +3 -0
- package/shell/configurations/bash/bashrc +36 -0
- package/shell/configurations/curl/cacert.pem +3460 -0
- package/shell/configurations/curl/curlrc +55 -0
- package/shell/configurations/default/color.sh +17 -0
- package/shell/configurations/default/editor.sh +16 -0
- package/shell/configurations/default/prompt.sh +37 -0
- package/shell/configurations/inputrc/inputrc +22 -0
- package/shell/configurations/jshint/jshintrc +37 -0
- package/shell/configurations/profile/profile +36 -0
- package/shell/configurations/tmux/tmux +95 -0
- package/shell/configurations/vim/vimrc +73 -0
- package/{.wgetrc → shell/configurations/wget/wgetrc} +4 -0
- package/shell/configurations/zsh/zshrc +40 -0
- package/shell/configurations.sh +10 -0
- package/shell/exit.sh +9 -0
- package/shell/functions/README.md +3 -0
- package/shell/functions/cdls.sh +19 -0
- package/shell/functions/changediskpwd.sh +19 -0
- package/shell/functions/code.sh +18 -0
- package/shell/functions/countdown.sh +33 -0
- package/shell/functions/curlheader.sh +20 -0
- package/shell/functions/curltime.sh +31 -0
- package/shell/functions/encode64.sh +25 -0
- package/shell/functions/environment.sh +37 -0
- package/shell/functions/extract.sh +32 -0
- package/shell/functions/filehead.sh +4 -0
- package/{zsh/zsh/functions/genpwd.zsh → shell/functions/genpwd.sh} +8 -3
- package/shell/functions/goto.sh +14 -0
- package/shell/functions/headers.sh +4 -0
- package/{zsh/zsh/functions/hidehiddenfiles.zsh → shell/functions/hidehiddenfiles.sh} +7 -2
- package/shell/functions/history-all.sh +7 -0
- package/shell/functions/hostinfo.sh +25 -0
- package/{zsh/zsh/functions/hstats.zsh → shell/functions/hstats.sh} +6 -1
- package/shell/functions/httpdebug.sh +7 -0
- package/shell/functions/keygen.sh +23 -0
- package/shell/functions/last.sh +9 -0
- package/shell/functions/logout.sh +10 -0
- package/shell/functions/lowercase.sh +28 -0
- package/shell/functions/macos.sh +47 -0
- package/shell/functions/matrix.sh +9 -0
- package/shell/functions/mcd.sh +18 -0
- package/shell/functions/mount_read_only.sh +9 -0
- package/shell/functions/myproc.sh +7 -0
- package/shell/functions/prependpath.sh +19 -0
- package/shell/functions/print.sh +13 -0
- package/shell/functions/ql.sh +7 -0
- package/shell/functions/rd.sh +15 -0
- package/shell/functions/remove_disk.sh +9 -0
- package/shell/functions/ren.sh +11 -0
- package/shell/functions/rm.sh +13 -0
- package/shell/functions/rps.sh +103 -0
- package/{zsh/zsh/functions/showhiddenfiles.zsh → shell/functions/showhiddenfiles.sh} +7 -2
- package/{zsh/zsh/functions/size.zsh → shell/functions/size.sh} +6 -1
- package/shell/functions/stopwatch.sh +13 -0
- package/shell/functions/trash.sh +13 -0
- package/shell/functions/tree.sh +13 -0
- package/shell/functions/uppercase.sh +28 -0
- package/shell/functions/uuidgen.sh +27 -0
- package/shell/functions/view-source.sh +8 -0
- package/shell/functions/vscode.sh +31 -0
- package/shell/functions/whoisport.sh +12 -0
- package/shell/functions/zipf.sh +14 -0
- package/shell/functions.sh +10 -0
- package/shell/history.sh +110 -0
- package/shell/paths/ant/ant.paths.sh +15 -0
- package/shell/paths/default/default.paths.sh +17 -0
- package/shell/paths/homebrew/homebrew.paths.sh +22 -0
- package/shell/paths/java/java.paths.sh +16 -0
- package/shell/paths/maven/maven.paths.sh +16 -0
- package/shell/paths/node/node.paths.sh +13 -0
- package/shell/paths/nvm/nvm.paths.sh +21 -0
- package/shell/paths/pnpm/pnpm.paths.sh +13 -0
- package/shell/paths/ruby/ruby.paths.sh +23 -0
- package/shell/paths/tmux/tmux.paths.sh +15 -0
- package/shell/paths.sh +12 -0
- package/.curlrc +0 -17
- package/.eslintrc +0 -44
- package/.jshintrc +0 -22
- package/.travis.yml +0 -21
- package/CODE_OF_CONDUCT.md +0 -46
- package/CONTRIBUTING.md +0 -60
- package/Dotfiles.png +0 -0
- package/ISSUE_TEMPLATE.md +0 -43
- package/bash/.bash_aliases +0 -409
- package/bash/.bash_exit +0 -25
- package/bash/.bash_functions +0 -312
- package/bash/.bash_load_completion +0 -62
- package/bash/.bash_profile +0 -295
- package/bash/.bashrc +0 -47
- package/homebrew/brew-cask.sh +0 -165
- package/homebrew/brew-package.sh +0 -256
- package/homebrew/brew-tap.sh +0 -35
- package/homebrew/install.sh +0 -29
- package/zsh/.zshrc +0 -64
- package/zsh/aliases.zsh +0 -427
- package/zsh/configurations.zsh +0 -19
- package/zsh/exit.zsh +0 -21
- package/zsh/functions.zsh +0 -42
- package/zsh/history.zsh +0 -53
- package/zsh/profile.zsh +0 -17
- package/zsh/zsh/configurations/color.zsh +0 -21
- package/zsh/zsh/configurations/editor.zsh +0 -21
- package/zsh/zsh/configurations/history.zsh +0 -53
- package/zsh/zsh/configurations/path.zsh +0 -123
- package/zsh/zsh/configurations/prompt.zsh +0 -24
- package/zsh/zsh/functions/cd.zsh +0 -51
- package/zsh/zsh/functions/cdls.zsh +0 -11
- package/zsh/zsh/functions/changediskpwd.zsh +0 -4
- package/zsh/zsh/functions/code.zsh +0 -2
- package/zsh/zsh/functions/countdown.zsh +0 -33
- package/zsh/zsh/functions/curlheader.zsh +0 -12
- package/zsh/zsh/functions/curltime.zsh +0 -12
- package/zsh/zsh/functions/extract.zsh +0 -27
- package/zsh/zsh/functions/goto.zsh +0 -8
- package/zsh/zsh/functions/history-all.zsh +0 -2
- package/zsh/zsh/functions/hostinfo.zsh +0 -19
- package/zsh/zsh/functions/httpdebug.zsh +0 -2
- package/zsh/zsh/functions/keygen.zsh +0 -18
- package/zsh/zsh/functions/logout.zsh +0 -5
- package/zsh/zsh/functions/lowercase.zsh +0 -23
- package/zsh/zsh/functions/matrix.zsh +0 -4
- package/zsh/zsh/functions/mcd.zsh +0 -11
- package/zsh/zsh/functions/mount_read_only.zsh +0 -4
- package/zsh/zsh/functions/myproc.zsh +0 -2
- package/zsh/zsh/functions/print.zsh +0 -8
- package/zsh/zsh/functions/ql.zsh +0 -2
- package/zsh/zsh/functions/rd.zsh +0 -8
- package/zsh/zsh/functions/remove_disk.zsh +0 -4
- package/zsh/zsh/functions/rm.zsh +0 -10
- package/zsh/zsh/functions/stopwatch.zsh +0 -8
- package/zsh/zsh/functions/trash.zsh +0 -8
- package/zsh/zsh/functions/tree.zsh +0 -8
- package/zsh/zsh/functions/uppercase.zsh +0 -23
- package/zsh/zsh/functions/zipf.zsh +0 -9
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Dotfiles aliases
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
The `gcloud.plugin.zsh` file creates helpful shortcut aliases for many commonly
|
|
6
|
+
[Google Cloud](https://cloud.google.com/) commands.
|
|
7
|
+
|
|
8
|
+
## Table of Contents
|
|
9
|
+
|
|
10
|
+
- [Dotfiles aliases](#dotfiles-aliases)
|
|
11
|
+
- [Table of Contents](#table-of-contents)
|
|
12
|
+
- [1.0 Google Cloud Aliases](#10-google-cloud-aliases)
|
|
13
|
+
- [1.1 Aliases to get going with the gcloud command-line tool](#11-aliases-to-get-going-with-the-gcloud-command-line-tool)
|
|
14
|
+
- [1.2 Aliases to make the Cloud SDK your own; personalize your configuration with properties](#12-aliases-to-make-the-cloud-sdk-your-own-personalize-your-configuration-with-properties)
|
|
15
|
+
- [1.3 Aliases to grant and revoke authorization to Cloud SDK](#13-aliases-to-grant-and-revoke-authorization-to-cloud-sdk)
|
|
16
|
+
- [1.4 Aliases to configuring Cloud Identity & Access Management (IAM) preferences and service accounts](#14-aliases-to-configuring-cloud-identity--access-management-iam-preferences-and-service-accounts)
|
|
17
|
+
- [1.5 Aliases to manage project access policies](#15-aliases-to-manage-project-access-policies)
|
|
18
|
+
- [1.6 Aliases to manage containerized applications on Kubernetes](#16-aliases-to-manage-containerized-applications-on-kubernetes)
|
|
19
|
+
- [1.7 Aliases to create, run, and manage VMs on Google infrastructure](#17-aliases-to-create-run-and-manage-vms-on-google-infrastructure)
|
|
20
|
+
- [1.8 Aliases to build highly scalable applications on a fully managed serverless platform](#18-aliases-to-build-highly-scalable-applications-on-a-fully-managed-serverless-platform)
|
|
21
|
+
- [1.9 Aliases to commands that might come in handy](#19-aliases-to-commands-that-might-come-in-handy)
|
|
22
|
+
|
|
23
|
+
### 1.0 Google Cloud Aliases
|
|
24
|
+
|
|
25
|
+
### 1.1 Aliases to get going with the gcloud command-line tool
|
|
26
|
+
|
|
27
|
+
| Alias | Command | Description |
|
|
28
|
+
| ----- | ---------------------------------------- | -------------------------------------------------- |
|
|
29
|
+
| gcci | `gcloud components install` | Install specific components. |
|
|
30
|
+
| gccsp | `gcloud config set project` | Set a default Google Cloud project to work on. |
|
|
31
|
+
| gccu | `gcloud components update` | Update your Cloud SDK to the latest version. |
|
|
32
|
+
| gci | `gcloud init` | Initialize, authorize, and configure the gcloud tool. |
|
|
33
|
+
| gcinf | `gcloud info` | Display current gcloud tool environment details. |
|
|
34
|
+
| gcv | `gcloud version` | Display version and installed components. |
|
|
35
|
+
|
|
36
|
+
### 1.2 Aliases to make the Cloud SDK your own; personalize your configuration with properties
|
|
37
|
+
|
|
38
|
+
| Alias | Command | Description |
|
|
39
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
40
|
+
| gccca | `gcloud config configurations activate` | Switch to an existing named configuration. |
|
|
41
|
+
| gcccc | `gcloud config configurations create` | Create a new named configuration. |
|
|
42
|
+
| gcccl | `gcloud config configurations list` | Display a list of all available configurations. |
|
|
43
|
+
| gccgv | `gcloud config get-value` | Fetch value of a Cloud SDK property. |
|
|
44
|
+
| gccl | `gcloud config list` | Display all the properties for the current configuration. |
|
|
45
|
+
| gccs | `gcloud config set` | Define a property (like compute/zone) for the current configuration. |
|
|
46
|
+
|
|
47
|
+
### 1.3 Aliases to grant and revoke authorization to Cloud SDK
|
|
48
|
+
|
|
49
|
+
| Alias | Command | Description |
|
|
50
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
51
|
+
| gcaasa | `gcloud auth activate-service-account` | Like gcloud auth login but with service account credentials. |
|
|
52
|
+
| gcacd | `gcloud auth configure-docker` | Register the gcloud tool as a Docker credential helper. |
|
|
53
|
+
| gcal | `gcloud auth list` | List all credentialed accounts. |
|
|
54
|
+
| gcal | `gcloud auth login` | Authorize Google Cloud access for the gcloud tool with Google user credentials and set current account as active. |
|
|
55
|
+
| gcapat | `gcloud auth print-access-token` | Display the current account's access token. |
|
|
56
|
+
| gcar | `gcloud auth revoke` | Remove access credentials for an account. |
|
|
57
|
+
|
|
58
|
+
### 1.4 Aliases to configuring Cloud Identity & Access Management (IAM) preferences and service accounts
|
|
59
|
+
|
|
60
|
+
| Alias | Command | Description |
|
|
61
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
62
|
+
| gciamk | `gcloud iam service-accounts keys list` | List a service account's keys. |
|
|
63
|
+
| gciaml | `gcloud iam list-grantable-roles` | List IAM grantable roles for a resource. |
|
|
64
|
+
| gciamp | `gcloud iam service-accounts add-iam-policy-binding` | Add an IAM policy binding to a service account. |
|
|
65
|
+
| gciamr | `gcloud iam roles create` | Create a custom role for a project or org. |
|
|
66
|
+
| gciams | `gcloud iam service-accounts set-iam-policy` | Replace existing IAM policy binding. |
|
|
67
|
+
| gciamv | `gcloud iam service-accounts create` | Create a service account for a project. |
|
|
68
|
+
|
|
69
|
+
### 1.5 Aliases to manage project access policies
|
|
70
|
+
|
|
71
|
+
| Alias | Command | Description |
|
|
72
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
73
|
+
| gcpa | `gcloud projects add-iam-policy-binding` | Add an IAM policy binding to a specified project. |
|
|
74
|
+
| gcpd | `gcloud projects describe` | Display metadata for a project (including its ID). |
|
|
75
|
+
|
|
76
|
+
### 1.6 Aliases to manage containerized applications on Kubernetes
|
|
77
|
+
|
|
78
|
+
| Alias | Command | Description |
|
|
79
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
80
|
+
| gcccc | `gcloud container clusters create` | Create a cluster to run GKE containers. |
|
|
81
|
+
| gcccg | `gcloud container clusters get-credentials` | Update kubeconfig to get kubectl to use a GKE cluster. |
|
|
82
|
+
| gcccl | `gcloud container clusters list` | List clusters for running GKE containers. |
|
|
83
|
+
| gccil | `gcloud container images list-tags` | List tag and digest metadata for a container image. |
|
|
84
|
+
|
|
85
|
+
### 1.7 Aliases to create, run, and manage VMs on Google infrastructure
|
|
86
|
+
|
|
87
|
+
| Alias | Command | Description |
|
|
88
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
89
|
+
| gcpc | `gcloud compute copy-files` | Copy files |
|
|
90
|
+
| gcpdown | `gcloud compute instances stop` | Stop instance |
|
|
91
|
+
| gcpds | `gcloud compute disks snapshot` | Create snapshot of persistent disks. |
|
|
92
|
+
| gcpid | `gcloud compute instances describe` | Display a VM instance's details. |
|
|
93
|
+
| gcpil | `gcloud compute instances list` | List all VM instances in a project. |
|
|
94
|
+
| gcprm | `gcloud compute instances delete` | Delete instance |
|
|
95
|
+
| gcpsk | `gcloud compute snapshots delete` | Delete a snapshot. |
|
|
96
|
+
| gcpssh | `gcloud compute ssh` | Connect to a VM instance by using SSH. |
|
|
97
|
+
| gcpup | `gcloud compute instances start` | Start instance. |
|
|
98
|
+
| gcpzl | `gcloud compute zones list` | List Compute Engine zones. |
|
|
99
|
+
|
|
100
|
+
### 1.8 Aliases to build highly scalable applications on a fully managed serverless platform
|
|
101
|
+
|
|
102
|
+
| Alias | Command | Description |
|
|
103
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
104
|
+
| gcapb | `gcloud app browse` | Open the current app in a web browser. |
|
|
105
|
+
| gcapc | `gcloud app create` | Create an App Engine app within your current project. |
|
|
106
|
+
| gcapd | `gcloud app deploy` | Deploy your app's code and configuration to the App Engine server. |
|
|
107
|
+
| gcapl | `gcloud app logs read` | Display the latest App Engine app logs. |
|
|
108
|
+
| gcapv | `gcloud app versions list` | List all versions of all services deployed to the App Engine server. |
|
|
109
|
+
|
|
110
|
+
### 1.9 Aliases to commands that might come in handy
|
|
111
|
+
|
|
112
|
+
| Alias | Command | Description |
|
|
113
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
114
|
+
| gckmsd | `gcloud kms decrypt` | Decrypt ciphertext (to a plaintext file) using a Cloud Key Management Service (Cloud KMS) key. |
|
|
115
|
+
| gclll | `gcloud logging logs list` | List your project's logs. |
|
|
116
|
+
| gcsqlb | `gcloud sql backups describe` | Display info about a Cloud SQL instance backup. |
|
|
117
|
+
| gcsqle | `gcloud sql export sql` | Export data from a Cloud SQL instance to a SQL file. |
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.452) - https://dotfiles.io
|
|
3
|
+
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
4
|
+
# License: MIT
|
|
5
|
+
|
|
6
|
+
# 🅶🅲🅻🅾🆄🅳 🅰🅻🅸🅰🆂🅴🆂 - Google Cloud aliases.
|
|
7
|
+
# Sections:
|
|
8
|
+
#
|
|
9
|
+
# 1.0 Google Cloud Aliases.
|
|
10
|
+
# 1.1 Aliases to get going with the gcloud command-line tool.
|
|
11
|
+
# 1.2 Aliases to make the Cloud SDK your own; personalize your configuration with properties.
|
|
12
|
+
# 1.3 Aliases to grant and revoke authorization to Cloud SDK.
|
|
13
|
+
# 1.4 Aliases to configuring Cloud Identity & Access Management (IAM) preferences and service accounts.
|
|
14
|
+
# 1.5 Aliases to manage project access policies.
|
|
15
|
+
# 1.6 Aliases to manage containerized applications on Kubernetes.
|
|
16
|
+
# 1.7 Aliases to create, run, and manage VMs on Google infrastructure.
|
|
17
|
+
# 1.8 Aliases to build highly scalable applications on a fully managed serverless platform.
|
|
18
|
+
# 1.9 Aliases to commands that might come in handy.
|
|
19
|
+
#
|
|
20
|
+
# Copyright (c) Sebastien Rousseau 2022. All rights reserved
|
|
21
|
+
# Licensed under the MIT license
|
|
22
|
+
#
|
|
23
|
+
|
|
24
|
+
## ----------------------------------------------------------------------------
|
|
25
|
+
## 1.0 Google Cloud Aliases.
|
|
26
|
+
## ----------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
## ----------------------------------------------------------------------------
|
|
29
|
+
## 1.1 Aliases to get going with the gcloud command-line tool.
|
|
30
|
+
## ----------------------------------------------------------------------------
|
|
31
|
+
|
|
32
|
+
alias gcci='gcloud components install' # Install specific components.
|
|
33
|
+
alias gccsp='gcloud config set project' # Set a default Google Cloud project to work on.
|
|
34
|
+
alias gccu='gcloud components update' # Update your Cloud SDK to the latest version.
|
|
35
|
+
alias gci='gcloud init' # Initialize, authorize, and configure the gcloud tool.
|
|
36
|
+
alias gcinf='gcloud info' # Display current gcloud tool environment details.
|
|
37
|
+
alias gcv='gcloud version' # Display version and installed components.
|
|
38
|
+
|
|
39
|
+
## ----------------------------------------------------------------------------
|
|
40
|
+
## 1.2 Aliases to make the Cloud SDK your own; personalize your configuration with properties.
|
|
41
|
+
## ----------------------------------------------------------------------------
|
|
42
|
+
|
|
43
|
+
alias gccca='gcloud config configurations activate' # Switch to an existing named configuration.
|
|
44
|
+
alias gcccc='gcloud config configurations create' # Create a new named configuration.
|
|
45
|
+
alias gcccl='gcloud config configurations list' # Display a list of all available configurations.
|
|
46
|
+
alias gccgv='gcloud config get-value' # Fetch value of a Cloud SDK property.
|
|
47
|
+
alias gccl='gcloud config list' # Display all the properties for the current configuration.
|
|
48
|
+
alias gccs='gcloud config set' # Define a property (like compute/zone) for the current configuration.
|
|
49
|
+
|
|
50
|
+
## ----------------------------------------------------------------------------
|
|
51
|
+
## 1.3 Aliases to grant and revoke authorization to Cloud SDK.
|
|
52
|
+
## ----------------------------------------------------------------------------
|
|
53
|
+
|
|
54
|
+
alias gcaasa='gcloud auth activate-service-account' # Like gcloud auth login but with service account credentials.
|
|
55
|
+
alias gcacd='gcloud auth configure-docker' # Register the gcloud tool as a Docker credential helper.
|
|
56
|
+
alias gcal='gcloud auth list' # List all credentialed accounts.
|
|
57
|
+
alias gcal='gcloud auth login' # Authorize Google Cloud access for the gcloud tool with Google user credentials and set current account as active.
|
|
58
|
+
alias gcapat='gcloud auth print-access-token' # Display the current account's access token.
|
|
59
|
+
alias gcar='gcloud auth revoke' # Remove access credentials for an account.
|
|
60
|
+
|
|
61
|
+
## ----------------------------------------------------------------------------
|
|
62
|
+
## 1.4 Aliases to configuring Cloud Identity & Access Management (IAM) preferences and service accounts.
|
|
63
|
+
## ----------------------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
alias gciamk='gcloud iam service-accounts keys list' # List a service account's keys.
|
|
66
|
+
alias gciaml='gcloud iam list-grantable-roles' # List IAM grantable roles for a resource.
|
|
67
|
+
alias gciamp='gcloud iam service-accounts add-iam-policy-binding' # Add an IAM policy binding to a service account.
|
|
68
|
+
alias gciamr='gcloud iam roles create' # Create a custom role for a project or org.
|
|
69
|
+
alias gciams='gcloud iam service-accounts set-iam-policy' # Replace existing IAM policy binding.
|
|
70
|
+
alias gciamv='gcloud iam service-accounts create' # Create a service account for a project.
|
|
71
|
+
|
|
72
|
+
## ----------------------------------------------------------------------------
|
|
73
|
+
## 1.5 Aliases to manage project access policies.
|
|
74
|
+
## ----------------------------------------------------------------------------
|
|
75
|
+
|
|
76
|
+
alias gcpa='gcloud projects add-iam-policy-binding' # Add an IAM policy binding to a specified project.
|
|
77
|
+
alias gcpd='gcloud projects describe' # Display metadata for a project (including its ID).
|
|
78
|
+
|
|
79
|
+
## ----------------------------------------------------------------------------
|
|
80
|
+
## 1.6 Aliases to manage containerized applications on Kubernetes.
|
|
81
|
+
## ----------------------------------------------------------------------------
|
|
82
|
+
|
|
83
|
+
alias gcccc='gcloud container clusters create' # Create a cluster to run GKE containers.
|
|
84
|
+
alias gcccg='gcloud container clusters get-credentials' # Update kubeconfig to get kubectl to use a GKE cluster.
|
|
85
|
+
alias gcccl='gcloud container clusters list' # List clusters for running GKE containers.
|
|
86
|
+
alias gccil='gcloud container images list-tags' # List tag and digest metadata for a container image.
|
|
87
|
+
|
|
88
|
+
## ----------------------------------------------------------------------------
|
|
89
|
+
## 1.7 Aliases to create, run, and manage VMs on Google infrastructure.
|
|
90
|
+
## ----------------------------------------------------------------------------
|
|
91
|
+
|
|
92
|
+
alias gcpc='gcloud compute copy-files' # Copy files
|
|
93
|
+
alias gcpdown='gcloud compute instances stop' # Stop instance
|
|
94
|
+
alias gcpds='gcloud compute disks snapshot' # Create snapshot of persistent disks.
|
|
95
|
+
alias gcpid='gcloud compute instances describe' # Display a VM instance's details.
|
|
96
|
+
alias gcpil='gcloud compute instances list' # List all VM instances in a project.
|
|
97
|
+
alias gcprm='gcloud compute instances delete' # Delete instance
|
|
98
|
+
alias gcpsk='gcloud compute snapshots delete' # Delete a snapshot.
|
|
99
|
+
alias gcpssh='gcloud compute ssh' # Connect to a VM instance by using SSH.
|
|
100
|
+
alias gcpup='gcloud compute instances start' # Start instance.
|
|
101
|
+
alias gcpzl='gcloud compute zones list' # List Compute Engine zones.
|
|
102
|
+
|
|
103
|
+
## ----------------------------------------------------------------------------
|
|
104
|
+
## 1.8 Aliases to build highly scalable applications on a fully managed serverless platform.
|
|
105
|
+
## ----------------------------------------------------------------------------
|
|
106
|
+
|
|
107
|
+
alias gcapb='gcloud app browse' # Open the current app in a web browser.
|
|
108
|
+
alias gcapc='gcloud app create' # Create an App Engine app within your current project.
|
|
109
|
+
alias gcapd='gcloud app deploy' # Deploy your app's code and configuration to the App Engine server.
|
|
110
|
+
alias gcapl='gcloud app logs read' # Display the latest App Engine app logs.
|
|
111
|
+
alias gcapv='gcloud app versions list' # List all versions of all services deployed to the App Engine server.
|
|
112
|
+
|
|
113
|
+
## ----------------------------------------------------------------------------
|
|
114
|
+
## 1.9 Aliases to commands that might come in handy.
|
|
115
|
+
## ----------------------------------------------------------------------------
|
|
116
|
+
|
|
117
|
+
alias gckmsd='gcloud kms decrypt' # Decrypt ciphertext (to a plaintext file) using a Cloud Key Management Service (Cloud KMS) key.
|
|
118
|
+
alias gclll='gcloud logging logs list' # List your project's logs.
|
|
119
|
+
alias gcsqlb='gcloud sql backups describe' # Display info about a Cloud SQL instance backup.
|
|
120
|
+
alias gcsqle='gcloud sql export sql' # Export data from a Cloud SQL instance to a SQL file.
|
|
121
|
+
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
# Dotfiles aliases
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
The `git.plugin.zsh` file creates helpful shortcut aliases for many commonly
|
|
6
|
+
[Git](https://www.heroku.com/) commands.
|
|
7
|
+
|
|
8
|
+
## Table of Contents
|
|
9
|
+
|
|
10
|
+
- [Dotfiles aliases](#dotfiles-aliases)
|
|
11
|
+
- [Table of Contents](#table-of-contents)
|
|
12
|
+
- [1.0 Git Core Aliases](#10-git-core-aliases)
|
|
13
|
+
- [1.1 Aliases to work on the current change](#11-aliases-to-work-on-the-current-change)
|
|
14
|
+
- [1.2 Aliases to start a working area](#12-aliases-to-start-a-working-area)
|
|
15
|
+
- [1.3 Aliases to examine the history and state](#13-aliases-to-examine-the-history-and-state)
|
|
16
|
+
- [1.4 Aliases to list, create, or delete branches](#14-aliases-to-list-create-or-delete-branches)
|
|
17
|
+
- [1.5 Aliases to collaborate](#15-aliases-to-collaborate)
|
|
18
|
+
- [1.6 Aliases to record changes to the repository](#16-aliases-to-record-changes-to-the-repository)
|
|
19
|
+
- [1.7 Aliases to show changes between commits, commit and working tree, etc](#17-aliases-to-show-changes-between-commits-commit-and-working-tree-etc)
|
|
20
|
+
- [1.8 Aliases to show commit logs](#18-aliases-to-show-commit-logs)
|
|
21
|
+
- [1.9 Aliases to switch branches or restore working tree files](#19--aliases-to-switch-branches-or-restore-working-tree-files)
|
|
22
|
+
- [2.0 Aliases to update remote refs along with associated objects](#20-aliases-to-update-remote-refs-along-with-associated-objects)
|
|
23
|
+
- [2.1 Aliases to manage set of tracked repositories](#21-aliases-to-manage-set-of-tracked-repositories)
|
|
24
|
+
- [2.2 Aliases to revert some existing commits](#22-aliases-to-revert-some-existing-commits)
|
|
25
|
+
- [2.3 Aliases to initialize, update or inspect submodules](#23-aliases-to-initialize-update-or-inspect-submodules)
|
|
26
|
+
- [2.4 Aliases to show the working tree status](#24-aliases-to-show-the-working-tree-status)
|
|
27
|
+
- [2.5 Aliases to create, list, delete or verify a tag object signed with GPG](#25-aliases-to-create-list-delete-or-verify-a-tag-object-signed-with-gpg)
|
|
28
|
+
- [2.6 Aliases to show various types of objects](#26-aliases-to-show-various-types-of-objects)
|
|
29
|
+
- [2.7 Aliases to reset current HEAD to the specified state](#27-aliases-to-reset-current-head-to-the-specified-state)
|
|
30
|
+
- [2.8 Aliases to pick out and massage parameters](#28-aliases-to-pick-out-and-massage-parameters)
|
|
31
|
+
- [2.9 Aliases to remove files from the working tree and from the index.](#29-aliases-to-remove-files-from-the-working-tree-and-from-the-index)
|
|
32
|
+
- [3.0 Aliases to show what revision and author last modified each line of a file](#30-aliases-to-show-what-revision-and-author-last-modified-each-line-of-a-file)
|
|
33
|
+
- [3.1 Aliases to get and set repository or global options](#31-aliases-to-get-and-set-repository-or-global-options)
|
|
34
|
+
|
|
35
|
+
### 1.0 Git Core Aliases
|
|
36
|
+
|
|
37
|
+
### 1.1 Aliases to work on the current change
|
|
38
|
+
|
|
39
|
+
| Alias | Command | Description |
|
|
40
|
+
| ----- | ---------------------------------------- | -------------------------------------------------- |
|
|
41
|
+
| g | `git` | Short-form git commands. |
|
|
42
|
+
| ga | `git add` | Add file contents to the index. |
|
|
43
|
+
| gaa | `git add --all` | Add file contents and update the index not only where the working tree has a file matching <pathspec> but also where the index already has an entry. |
|
|
44
|
+
| gad | `git add .` | Add current directory file contents to the index. |
|
|
45
|
+
| gau | `git add --update` | Add file contents and update the index just where it already has an entry matching <pathspec>. |
|
|
46
|
+
| gco | `git checkout` | Undo to last commit. |
|
|
47
|
+
| gdis | `git checkout --` | Discard changes in a (list of) file(s) in working tree. |
|
|
48
|
+
| gmv | `git mv` | Move or rename a file, a directory, or a symlink. |
|
|
49
|
+
| grs | `git restore` | Restore working tree files. |
|
|
50
|
+
| gsc | `git sparse-checkout` | Initialize and modify the sparse-checkout. |
|
|
51
|
+
|
|
52
|
+
### 1.2 Aliases to start a working area
|
|
53
|
+
|
|
54
|
+
| Alias | Command | Description |
|
|
55
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
56
|
+
| gcl | `git clone` | Clone a repository into a new directory. |
|
|
57
|
+
| gin | `git init` | Create an empty Git repository or reinitialize an existing one. |
|
|
58
|
+
|
|
59
|
+
### 1.3 Aliases to examine the history and state
|
|
60
|
+
|
|
61
|
+
| Alias | Command | Description |
|
|
62
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
63
|
+
| gbs | `git bisect` | Use binary search to find the commit that introduced a bug. |
|
|
64
|
+
| gd | `git diff` | Show changes between commits, commit and working tree, etc. |
|
|
65
|
+
| gg | `git grep` | Print lines matching a pattern. |
|
|
66
|
+
| gl | `git log --since="last month" --oneline` | Show commit logs this month. |
|
|
67
|
+
| glg | `git log --oneline --graph --full-history --all --color --decorate` | Show commit logs and Draw a text-based graphical representation of the commit history on the left hand side of the output. |
|
|
68
|
+
| gs | `git show` | Show various types of objects. |
|
|
69
|
+
|
|
70
|
+
### 1.4 Aliases to list, create, or delete branches
|
|
71
|
+
|
|
72
|
+
| Alias | Command | Description |
|
|
73
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
74
|
+
| gb | `git branch` | Create a branch. |
|
|
75
|
+
| gbd | `git branch -d` | Delete a branch. |
|
|
76
|
+
| gbl | `git branch -l` | List branches. |
|
|
77
|
+
| gbr | `git branch -r` | List the remote-tracking branches. |
|
|
78
|
+
| gbrd | `git branch -d -r` | Delete the remote-tracking branches. |
|
|
79
|
+
| gbrsb | `git show-branch` | Print a list of branches and their commits. |
|
|
80
|
+
| gct | `git commit` | Record changes to the repository. |
|
|
81
|
+
| gmg | `git merge` | Join two or more development histories together. |
|
|
82
|
+
| grb | `git rebase` | Reapply commits on top of another base tip. |
|
|
83
|
+
| grs | `git reset` | Reset current HEAD to the specified state. |
|
|
84
|
+
| gswb | `git switch` | Switch branches. |
|
|
85
|
+
|
|
86
|
+
### 1.5 Aliases to collaborate
|
|
87
|
+
|
|
88
|
+
| Alias | Command | Description |
|
|
89
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
90
|
+
| gf | `git fetch` | Download objects and refs from another repository. |
|
|
91
|
+
| gi | `git init` | Create an empty Git repository or reinitialize an existing one. |
|
|
92
|
+
| gp | `git pull` | Fetch from and integrate with another repository or a local branch. |
|
|
93
|
+
| gpu | `git push` | Update remote refs along with associated objects. |
|
|
94
|
+
|
|
95
|
+
### 1.6 Aliases to record changes to the repository
|
|
96
|
+
|
|
97
|
+
| Alias | Command | Description |
|
|
98
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
99
|
+
| gc | `git commit -a` | Commit command to automatically "add" changes from all known files. |
|
|
100
|
+
| gca | `git commit --amend` | Amend the tip of the current branch rather than creating a new commit. |
|
|
101
|
+
| gcall | `git add -A && git commit -av` | Commit all changes. |
|
|
102
|
+
| gcam | `git commit --amend --message ` | Amend the tip of the current branch, and edit the message. |
|
|
103
|
+
| gcane | `git commit --amend --no-edit` | Amend the tip of the current branch, and do not edit the message. |
|
|
104
|
+
| gcint | `git commit --interactive` | Commit interactive. |
|
|
105
|
+
| gcm | `git commit --message ` | Commit with a message. |
|
|
106
|
+
|
|
107
|
+
### 1.7 Aliases to show changes between commits, commit and working tree, etc
|
|
108
|
+
|
|
109
|
+
| Alias | Command | Description |
|
|
110
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
111
|
+
| gd | `git diff` | Show changes between the working tree and the index or a tree. |
|
|
112
|
+
| gdcached | `git diff --cached` | Shows the changes between the index and the HEAD (which is the last commit on this branch). |
|
|
113
|
+
| gdch | `git diff --name-status` | Show only names and status of changed files. |
|
|
114
|
+
| gdh | `git diff HEAD` | Show all changes of tracked files which are present in working directory and staging area. |
|
|
115
|
+
| gdstaged | `git diff --staged` | Show changes to files in the "staged" area. |
|
|
116
|
+
| gdstat | `git diff --stat --ignore-space-change -r` | Generate a diffstat. |
|
|
117
|
+
|
|
118
|
+
### 1.8 Aliases to show commit logs
|
|
119
|
+
|
|
120
|
+
| Alias | Command | Description |
|
|
121
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
122
|
+
| gclc | `git log --oneline --reverse` | Show log of changes, most recent first. |
|
|
123
|
+
| gld | `git log --since=1-day-ago` | Show the log of the recent day |
|
|
124
|
+
| gldc | `git log -1 --date-order --format=%cI` | Show the date of the latest commit, in strict ISO 8601 format.|
|
|
125
|
+
| gldl | `git log --date=local` | Show log with dates in our local timezone. |
|
|
126
|
+
| glf | `git log ORIG_HEAD.. --stat --no-merges` | Show log of new commits after you fetched, with stats, excluding merges. |
|
|
127
|
+
| glfd | `!"git log --date-order --format=%cI | tail -1"` | Show the date of the earliest commit, in strict ISO 8601 format. |
|
|
128
|
+
| glfh | `git log --graph --full-history --all --color` | Visualization of branch topology. |
|
|
129
|
+
| glg | `git log --graph --all --oneline --decorate` | Show log as a graph. |
|
|
130
|
+
| glh | `git log --since=1-hour-ago` | Show the log of the recent hour |
|
|
131
|
+
| gll | `git log --graph --topo-order --date=short --abbrev-commit --decorate --all --boundary --pretty=format:"%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn]%Creset %Cblue%G?%Creset"` | Show log in our preferred format for our key performance indicators. A.k.a. `ll`. |
|
|
132
|
+
| glll | `git log --graph --topo-order --date=iso8601-strict --no-abbrev-commit --decorate --all --boundary --pretty=format:"%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn <%ce>]%Creset %Cblue%G?%Creset"` | Show log in our preferred format for our key performance indicators, with long items. A.k.a. `lll`. |
|
|
133
|
+
| glm | `git log --since=1-month-ago` | Show the log of the recent month |
|
|
134
|
+
| glmy | `!git log --author $(git config user.email)` | Show the log for my own commits by my own user email. |
|
|
135
|
+
| glw | `git log --since=1-week-ago` | Show the log of the recent week |
|
|
136
|
+
| gly | `git log --since=1-year-ago` | Show the log of the recent year |
|
|
137
|
+
|
|
138
|
+
### 1.9 Aliases to switch branches or restore working tree files
|
|
139
|
+
|
|
140
|
+
| Alias | Command | Description |
|
|
141
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
142
|
+
| gclout | `git clean -df && git checkout -- .` | Clean and discard changes and un-tracked files in working tree. |
|
|
143
|
+
| gco | `git checkout` | Switch branches or restore working tree files. |
|
|
144
|
+
| gcob | `git checkout -b` | Create a new branch named <new_branch> and start it at <start_point>. |
|
|
145
|
+
| gcode | `git checkout main && git branch --merged | xargs git branch --delete` | Delete all local branches that have been merged into the local main branch. |
|
|
146
|
+
| gcom | `git checkout main && git fetch origin --prune && git reset --hard origin/main` | Ensure local is like the main branch. |
|
|
147
|
+
|
|
148
|
+
### 2.0 Aliases to update remote refs along with associated objects
|
|
149
|
+
|
|
150
|
+
| Alias | Command | Description |
|
|
151
|
+
| ----- | ---------------------------------------- | ------------------------------ |
|
|
152
|
+
| gpb | `git push --set-upstream origin $(git current-branch)` | Publish the current branch by pushing it to the remote "origin", and setting the current branch to track the upstream branch. |
|
|
153
|
+
| gpcb | `git push origin "$(git branch|grep '\*'|tr -d '* \n')"` | Push current branch |
|
|
154
|
+
| gpo | `git push origin` | Push local changes to the online repository. |
|
|
155
|
+
| gpoll | `git push origin --all` | Push each of your local git branches to the remote repository |
|
|
156
|
+
| gpt | `git push --tags` | Push local tags. |
|
|
157
|
+
| gpull | `git pull` | Fetch from and integrate with another repository or a local branch. |
|
|
158
|
+
| gpullo | `git pull origin $(git current-branch)` | Do a pull for just one branch. |
|
|
159
|
+
| gpullm | `git pull origin master` | Pull changes from the locally stored branch origin/master and merge that to the local checked-out branch. |
|
|
160
|
+
| gpush | `git push` | Update remote refs along with associated objects. |
|
|
161
|
+
| gpusho | `git push origin $(git current-branch)` | Do a push for just one branch. |
|
|
162
|
+
| gpushr | `git remote | xargs -I% -n1 git push %` | git remotes-push - For each remote branch, push it. |
|
|
163
|
+
| gunpub | `git push origin :$(git current-branch)` | Un-publish the current branch by deleting the remote version of the current branch. |
|
|
164
|
+
|
|
165
|
+
### 2.1 Aliases to manage set of tracked repositories
|
|
166
|
+
|
|
167
|
+
| Alias | Command | Description |
|
|
168
|
+
| ------- | ---------------------------------------- | ------------------------------ |
|
|
169
|
+
| gr | `git remote` | Manage set of tracked repositories. |
|
|
170
|
+
| gra | `git remote add` | Add a remote named <name> for the repository at <url>. |
|
|
171
|
+
| grall | `git remote | xargs -L1 git push --all` | Push all branches to all remotes. |
|
|
172
|
+
| grallo | `git remote -v | grep "(fetch)" | sed -e 's#[[:blank:]].*##g' | grep -v "origin" | xargs -n 1 git remote rm` | Git remote all remotes except origin. |
|
|
173
|
+
| grao | `git remote add origin` | Add a new remote 'origin' if it doesn't exist. |
|
|
174
|
+
| grbk | `git reset --soft HEAD^` | Rollback to stage. |
|
|
175
|
+
| grcl | `git remote prune` | Deletes all stale remote-tracking branches under <name>. |
|
|
176
|
+
| grf | `find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && echo '{}' && git config --get remote.origin.url" \;` | Show GIT Remote Origin for each immediate subfolder. |
|
|
177
|
+
| grfall | `git branch -r | awk -F'/' '{print "git fetch "$1,$2}' | xargs -I {} sh -c {}` | Fetch all git remotes for a repo. |
|
|
178
|
+
| gro | `open `git remote -v | awk '/fetch/{print $2}' | sed -Ee 's#(git@|git://)#http://#' -e 's@com:@com/@'`| head -n1` | Open current Git repository URL. |
|
|
179
|
+
| grp | `git remote | xargs -I% -n1 git push %` | For each remote branch, push it. |
|
|
180
|
+
| grpa | `for i in `git remote`; do git push $i; done;` | Push all remotes. |
|
|
181
|
+
| grprint | `git remote -v | sed -n '/github.com.*push/{s/^[^[:space:]]\+[[:space:]]\+//;s|git@github.com:|https://github.com/|;s/\.git.*//;p}` | Print the url for the current repo. |
|
|
182
|
+
| grs | `git show` | Gives some information about the remote <name>. |
|
|
183
|
+
| grso | `git remote show origin` | Display where the origin resides. |
|
|
184
|
+
| grv | `git remote -v` | Shows URLs of remote repositories when listing your current remote connections. |
|
|
185
|
+
| gru | `git remote update` | Fetch updates for a named set of remotes in the repository as defined by remotes. |
|
|
186
|
+
|
|
187
|
+
### 2.2 Aliases to revert some existing commits
|
|
188
|
+
|
|
189
|
+
| Alias | Command | Description |
|
|
190
|
+
| ------- | ---------------------------------------- | ------------------------------ |
|
|
191
|
+
| grev | `git revert` | Undo the changes from some existing commits. |
|
|
192
|
+
| grevnc | `git revert --no-commit` | Revert without autocommit; useful when you're reverting more than one commits' effect to your index in a row. |
|
|
193
|
+
|
|
194
|
+
### 2.3 Aliases to initialize, update or inspect submodules
|
|
195
|
+
|
|
196
|
+
| Alias | Command | Description |
|
|
197
|
+
| ------- | ---------------------------------------- | ------------------------------ |
|
|
198
|
+
| gsmi | `git submodule init` | Initialize the submodules recorded in the index. |
|
|
199
|
+
| gsma | `git submodule add` | Add the given repository as a Submodule at the given path to the changeset to be committed next to the current project: the current project is termed the "superproject". |
|
|
200
|
+
| gsm | `git submodule` | Enables foreign repositories to be embedded within a dedicated subdirectory of the source tree. |
|
|
201
|
+
| gsms | `git submodule sync` | Synchronizes submodules' remote URL configuration setting to the value specified in .gitmodules. |
|
|
202
|
+
| gsmu | `git submodule update` | Update the registered submodules to match what the superproject expects by cloning missing submodules, fetching missing commits in submodules and updating the working tree of the submodules. |
|
|
203
|
+
| gsmui | `git submodule update --init` | Submodule update with initialize. |
|
|
204
|
+
| gsmuir | `git submodule update --init --recursive` | Submodule update with initialize and recursive; this is useful to bring a submodule fully up to datec
|
|
205
|
+
|
|
206
|
+
### 2.4 Aliases to show the working tree status
|
|
207
|
+
|
|
208
|
+
| Alias | Command | Description |
|
|
209
|
+
| ------- | ---------------------------------------- | ------------------------------ |
|
|
210
|
+
| gst | `git status` | Show the working tree status. |
|
|
211
|
+
| gstrmu | `git status -su | cut -d' ' -f2- | tr '\n' '\0' | xargs -0 rm` | Remove untracked files in a git repository. |
|
|
212
|
+
| gsts | `git status --short` | Status with short format instead of full details. |
|
|
213
|
+
| gstsb | `git status --short --branch` | Status with short format and showing branch and tracking info. |
|
|
214
|
+
|
|
215
|
+
### 2.5 Aliases to create, list, delete or verify a tag object signed with GPG
|
|
216
|
+
|
|
217
|
+
| Alias | Command | Description |
|
|
218
|
+
| ------- | ---------------------------------------- | ------------------------------ |
|
|
219
|
+
| gt | `git tag` | gt: See all tags. |
|
|
220
|
+
| gta | `git tag -a $1 -m $2` | gta: Add a tag. |
|
|
221
|
+
| gtg | `git tag` | gtg: Create, list, delete or verify a tag object signed with GPG. |
|
|
222
|
+
| gtl | `git describe --tags --abbrev=0` | gtl: Last tag in the current branch. |
|
|
223
|
+
| gtrm | `for t in `git tag` do; git push origin :$t; git tag -d $t; done` | gtrm: Delete all tags. |
|
|
224
|
+
|
|
225
|
+
### 2.6 Aliases to show various types of objects
|
|
226
|
+
|
|
227
|
+
| Alias | Command | Description |
|
|
228
|
+
| ------- | ---------------------------------------- | ------------------------------ |
|
|
229
|
+
| gshab | `for k in ``git branch|perl -pe s/^..//``;do echo -e ``git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1``\\t$k;done|sort -r` | Show git branches by date - useful for showing active branches. |
|
|
230
|
+
| gshf | `git show-branch -a | grep '\*' | grep -v 'git rev-parse --abbrev-ref HEAD' | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'` | Find the nearest parent branch of the current git branch. |
|
|
231
|
+
| gshls | `git show --relative --pretty=format:''` | Show list of files changed by commit. |
|
|
232
|
+
| gshnp | `git show --no-patch --pretty="tformat:%h (%s, %ad)" --date=short` | Given any git object, try to show it briefly. |
|
|
233
|
+
| gshwho | `git shortlog --summary --numbered --no-merges` | Show who contributed, in descending order by number of commits. |
|
|
234
|
+
|
|
235
|
+
### 2.7 Aliases to reset current HEAD to the specified state
|
|
236
|
+
|
|
237
|
+
| Alias | Command | Description |
|
|
238
|
+
| ------- | ---------------------------------------- | --------------------- |
|
|
239
|
+
| grescl | `git reset --hard HEAD~1 && git clean -fd` | Reset commit clean. |
|
|
240
|
+
| gresh | `git reset --hard HEAD~1` | Reset commit hard. |
|
|
241
|
+
| gresp | `git reset --hard && git clean -ffdx` | Reset pristine. |
|
|
242
|
+
| gress | `git reset --soft HEAD~1` | Reset commit. |
|
|
243
|
+
| gresu | `git reset --hard $(git upstream-branch)` | Reset to upstream. |
|
|
244
|
+
|
|
245
|
+
### 2.8 Aliases to pick out and massage parameters
|
|
246
|
+
|
|
247
|
+
| Alias | Command | Description |
|
|
248
|
+
| ------- | ---------------------------------------- | --------------------- |
|
|
249
|
+
| gtp | `git rev-parse --show-toplevel` | Get the top level directory name. |
|
|
250
|
+
| gcb | `git rev-parse --abbrev-ref HEAD` | Get the current branch name. |
|
|
251
|
+
| gub | `git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD)` | Get the upstream branch name. |
|
|
252
|
+
|
|
253
|
+
### 2.9 Aliases to remove files from the working tree and from the index
|
|
254
|
+
|
|
255
|
+
| Alias | Command | Description |
|
|
256
|
+
| ------- | ---------------------------------------- | --------------------- |
|
|
257
|
+
| grm | `git rm` | Remove files from the working tree and from the index.
|
|
258
|
+
| grmc | `git rm --cached` | Unstage and remove paths only from the index.
|
|
259
|
+
| grmd | `git ls-files -z --deleted | xargs -0 git rm` | git remove files which have been deleted. |
|
|
260
|
+
| grmd2 | `git rm $(git ls-files --deleted)` | git remove files which have been deleted. |
|
|
261
|
+
| grmds | `find . -name .DS_Store -exec git rm --ignore-unmatch --cached {} +` | Remove .DS_Store from the repository. |
|
|
262
|
+
| grmn | `for file in $(git status | grep "new file" | sed "s/#\tnew file://"); do git rm --cached $file; done` | Remove all new files. |
|
|
263
|
+
| grmx | `git ls-files -z -d | xargs -0 git rm --` | Remove for all deleted files, including those with space/quote/unprintable characters in their filename/path. |
|
|
264
|
+
|
|
265
|
+
### 3.0 Aliases to show what revision and author last modified each line of a file
|
|
266
|
+
|
|
267
|
+
| Alias | Command | Description |
|
|
268
|
+
| ------- | ---------------------------------------- | --------------------- |
|
|
269
|
+
| gbl | `git blame --date short "$1"` | Specifies a format used to output short dates. |
|
|
270
|
+
| gblc | `git blame --line-porcelain "$1" | sed -n 's/^author //p' | sort | uniq -c | sort -rn` | Count the number of lines attributed to each author. |
|
|
271
|
+
| gblau | `git ls-files | xargs -n1 git blame --line-porcelain | sed -n 's/^author //p' | sort -f | uniq -ic | sort -nr` | Prints per-line contribution per author for a GIT repository. |
|
|
272
|
+
|
|
273
|
+
### 3.1 Aliases to get and set repository or global options
|
|
274
|
+
|
|
275
|
+
| Alias | Command | Description |
|
|
276
|
+
| ------- | ---------------------------------------- | --------------------- |
|
|
277
|
+
| gconfdiff | `git config alias.dcolor "diff --color-words"` | Better git diff, word delimited and colorized. |
|
|
278
|
+
| gconfl | `git config --list` | List all the settings. |
|
|
279
|
+
| gconfr | `git config --local --get remote.origin.url` | Output remote origin from within a local repository. |
|