Muhammad Yana Mulyana

Usefull Git Syntax

Hello there 👋 i'm lazy programmer, so i made usefull syntax for git 😁. May its usefull to for you 

CHANGE REMOTE ORIGIN URL
------------------------
cd existing_repo
git remote rename origin old-origin
git remote add origin [email protected]:account/reponame.git
git push -u origin --all
git push -u origin --tags


DELETE PREVIOS COMMIT
-----------------------
git reset --hard commit_id
make change files
commit
git push origin HEAD --force


FIXED GIT IGNORE
----------------
git rm -r --cached .
git add .
git commit -m "fixed untracked files"


LAZY COMMIT, PUSH AND DEPLOY 
-----------------------------

git add . && git commit -m ":art: :tada:" && git push

git add . && git commit -m ":gem: :rocket:" && git push

git add . && git commit -m ":art: :tada:" && git push && cap staging deploy
 
git add . && git commit -m ":art: :tada:" && git push && cap production deploy
 
git checkout staging && git merge master && git push && cap staging deploy
 
git checkout master && git merge staging && git push && cap production deploy