DevOps Buzz
Search…
Initial page
About me
Ansible
Cheat Sheet
Dynamic inventory
AKS
Cheat Sheet
Autoscale
Backup
Dashboard
Ingress
Node management
News
Persistent Volumes
Arch Linux
Docker
Install
Network
VirtualBox guest
Azure
API
CLI/Powershell
DevOps
Application Gateway
Tools
Sops
AWS
Cheat Sheet
Tools
Cognito with Amplify and React
Bash / Shell
Cheat Sheet
Tools
Bitbucket
Cheat Sheet
CSS
Cheat Sheet
Distros
Manjaro
Docker
Cheat Sheet
ELK
Ubuntu NoVNC
Tools
Known errors and solutions
Elasticsearch
Cheat Sheet
Tools
ELK
Cheat Sheet
emacs
Cheat sheet
Gatekeeper (OPA)
Cheat Sheet
Developer Quick Start
GCP
Cheat Sheet
General
Tools
News
Git
Cheat Sheet
Tools
Golang
Cheat Sheet
Guidelines / Standards
Cheat Sheet
i3wm
Cheat Sheet
Ipsec
Cheat sheet
Istio
Cheat Sheet
Kind
Cheat Sheet
Kops
Cheat Sheet
Kubeadm
Cheat Sheet
Change serviceSubnet CIDR
Setup cluster
Multi master
Known errors and solutions
Kubernetes
Kubectl Cheat Sheet
etcd Cheat Sheet
Tools
News
Deployments
Dashboard
ELK
Helm
Ingress
logz.io
Minikube
Monitoring
Node Management
Operators
Security
Volumes
Networking
kube-controller-manager
Known errors and solutions
Lumen
Cheat Sheet
MACOS
Cheat Sheet
Qemu
Zsh
microk8s
Cheat Sheet
MongoDB
Cheat Sheet
Tools
MySQL
Cheat Sheet
Network
Tools
WDS - Wireless Distribution System
Expose server under NAT
nvim
Cheat Sheet
Openvpn
OpenVPN server on Ubuntu 18.06
Stunnel
PHP
Composer
Prometheus
Tools
Python
Cheat Sheet
Pydantic
Tools / Modules
Virtualenv
RabbitMQ
Cheat Sheet
ReactJS
Fixes
For beginners
Ruby
Cheat Sheet
Rails
rvm
Rundeck
Cheat Sheet
Rust
Cheat Sheet
Squid
Setup server
Expose NAT server
SRE
Cheat Sheet
SSH
Passwordless auth with RSA key
Reverse tunnel
Cheat Sheet
SSL
Cheat Sheet
certbot
STACK SETUP
Using EKS and Gitlab CI to deploy applications
Terraform
Cheat Sheet
Tools
Tmux
Cheat Sheet
Tor
Cheat Sheet
Ubuntu
Cheat Sheet
Vagrant
Cheat Sheet
VirtualBox
Cheat Sheet
Windows
Windows Docker
Fingerprint
SSH Client
Tools
VirtualBox
WSL
Powered By
GitBook
Cheat Sheet
Useful git commands
Branch
Move changes to another branch
1
git
stash
2
​
3
# To create a new branch
4
git
checkout -b correct-branch
5
​
6
# To use an existing branch...
7
# git checkout correct-branch
8
​
9
git
stash pop
Copied!
Discard local changes
1
git
reset --hard origin/master
2
git
pull origin master
Copied!
Update parent branch
1
git
checkout feature_abc
2
git
checkout -b feature_def
3
# --> Someone changed something in feature_abc
4
git
pull origin feature_abc
Copied!
Clone
Git clone private repo
1
git
clone https://myemail%40gmail.com:
[email protected]
/my-group/my-repo.git
Copied!
Where:
myemail%40gmail.com
means
[email protected]
and it is your username;
123456
is your password;
Fork
Keeping a fork up to date
Clone your fork
1
git clone
[email protected]
:YOUR-USERNAME/YOUR-FORKED-REPO.git
Copied!
Add remote from original repository in your forked repository.
1
cd
into/cloned/fork-repo
2
git
remote
add
upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
3
git
fetch upstream
Copied!
Updating your fork from original repo to keep up with their changes.
1
git
pull upstream master
Copied!
Track forks
​
https://techgaun.github.io/active-forks/index.html
​
Manage credentials
Store credentials permanently
1
git
config credential.helper store
Copied!
Store credentials on cache
To avoid providing the same credentials every time, you may enable the Git credentials cache through the following command:
1
git
config --global credential.helper cache
Copied!
The default cache expiry timeout is 900 seconds (15 minutes) and can be changed with the
--timeout
option as follows:
1
git
config --global credential.helper
'cache --timeout=300'
Copied!
If you want the daemon to exit early, forgetting all cached credentials before their timeout, you can issue an exit action:
1
git
credential-cache
exit
Copied!
Module
Remove submodule
1
mv a/submodule a/submodule_tmp
2
git submodule deinit -f -- a/submodule
3
rm -rf .git/modules/a/submodule
4
git rm -f a/submodule
5
​
6
# or, if you want to leave it in your working tree and have done step 0
7
# git rm --cached a/submodule
8
mv a/submodule_tmp a/submodule
Copied!
References
​
https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule
​
Push
You cannot push commits for '
[email protected]
'. You can only push commits that were committed with one of your own verified emails.
1
git
commit --amend --reset-author --no-edit
2
git
config user.email
"
[email protected]
"
3
git
config user.name
"Your Name"
4
git
push origin your-branch
Copied!
Tag
Create
1
# Create tag
2
git
tag -a v1.0 -m
"Short description"
3
# List tag
4
git
tag
5
# Show tag
6
git
show v1.0
7
# Push tag
8
git
push origin v1.0
Copied!
Delete
1
git
tag -d v1.0
2
git
push --delete origin v1.0
Copied!
General - Previous
News
Next - Git
Tools
Last modified
3mo ago
Copy link
Contents
Branch
Move changes to another branch
Discard local changes
Update parent branch
Clone
Git clone private repo
Fork
Keeping a fork up to date
Track forks
Manage credentials
Store credentials permanently
Store credentials on cache
Module
Remove submodule
Push
You cannot push commits for '
[email protected]
'. You can only push commits that were committed with one of your own verified emails.
Tag
Create
Delete