devops_tips's profile picture. DevOps Tips and Tricks

devopstips

@devops_tips

DevOps Tips and Tricks

to list all the branches that already merged into master, run the following command; git branch --merged master #git #terminal #merged #master


to list changes staged but not yet committed, run the following command; git diff --staged #git #terminal #diff #stage

devops_tips's tweet image. to list changes staged but not yet committed, run the following command;

git diff --staged

#git #terminal #diff #stage

to list of all the changed files in a commit, run the following command; git diff-tree --no-commit-id --name-only -r <commit_id> #git #terminal #changes #commit

devops_tips's tweet image. to list of all the changed files in a commit, run the following command;

git diff-tree --no-commit-id --name-only -r &amp;lt;commit_id&amp;gt;

#git #terminal #changes #commit

To show changes to a specific file over time, run the following command; git log --pretty=oneline ./package.json #terminal #git #log

devops_tips's tweet image. To show changes to a specific file over time, run the following command;

git log --pretty=oneline ./package.json

#terminal #git #log

to set VS Code as the default editor with git global config, run the following command; git config --global core.editor "code --wait" #git #vscode #terminal


If you want your docker container to automatically restart if it closes for some reason (such as the application that are running has an error, etc) just add the following flag to docker run --restart=always for example docker run --restart=always IMAGE_NAME #docker #terminal


If you want to give memory limit (Memory Constraint) to a docker container, just run the following command; docker run --memory MAXIMUM_ALLOWED_MEMORY IMAGE_NAME #docker #terminal


If you want to give processor limit (CPU Constraint) to a docker container, just run the following command; docker run --cpu-quota MAXIMUM_ALLOWED_CPU IMAGE_NAME #docker #terminal


此帳戶目前尚未追蹤任何人
Loading...

Something went wrong.


Something went wrong.