Oh Crap! I don't know Markup !!
No worries Click-Me
git checkout -b branch-name
# when you run this command it will take checkout from branch in which you currently are.
git mergetool
git pull origin branch-name
git add file-name
git commit -m "commit-message"
git push origin branch-name
git merge branch-name
-
Rename your local branch.
If you are on the branch you want to rename: git branch -m new-name If you are on a different branch: git branch -m old-name new-name
-
Delete the old-name remote branch and push the new-name local branch.
git push origin :old-name new-name
-
Reset the upstream branch for the new-name local branch.
Switch to the branch and then: git push origin -u new-name ## Or you as a fast way to do that, you can use these 3 steps: command in your terminal git branch -m old_branch new_branch # Rename branch locally git push origin :old_branch # Delete the old branch git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
-
Delete local branch and then the remote branch.
git branch -d branch_name # The -d option stands for --delete, which would delete the local branch, only if you have already pushed and merged it with your remote branches. git branch -D branch_name # The -D option stands for --delete --force, which deletes the branch regardless of its push and merge status, so be careful using this one!
aws ec2 describe-instances --profile profile-name
# get the profile name from ~/.aws/config
export AWS_PROFILE=profile-name
vim /etc/systemd/system/start_docker.service
sudo vim /usr/local/bin/start-docker.sh
sudo chmod 744 /usr/local/bin/start-docker.sh
sudo chmod 664 /etc/systemd/system/start_docker.service
sudo systemctl daemon-reload
sudo systemctl enable start_docker.service
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
-- If you are using PostgreSQL 9.3 or greater, you may also need to restore the default grants.
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;
For Backup
docker exec -t your-db-container pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
For Restore
cat your_dump.sql | docker exec -i your-db-container psql -U postgres