How to work with git

Issue #531 Expand commits in Sublime Merge { "expand_merge_commits_by_default": true, "translate_tabs_to_spaces": true } local hooks .git/hooks vs hooksPath git config core.hooksPath ~/.git-templates/hooks Only hooksPath gets run. Removing hooksPath make local hooks work https://stackoverflow.com/questions/39332407/git-hooks-applying-git-config-core-hookspath Use git templates https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook Define alias in zshrc vim ~/.zshrc alias check="~/.git-templates/hooks/check.sh" source ~/.zshrc pre-commit https://itnext.io/using-git-hooks-to-enforce-branch-naming-policy-ffd81fa01e5e (feature|fix|refactor)\/[a-z0-9-]+$ ...

December 9, 2019 路 1 min 路 Khoa Pham

How to setup multiple git accounts for GitHub and Bitbucket

Issue #514 Generate SSH keys ssh-keygen -t rsa -C "onmyway133@gmail.com" -f "id_rsa_github" ssh-keygen -t rsa -C "onmyway133bitbucket@gmail.com" -f "id_rsa_bitbucket" pbcopy < ~/.ssh/id_rsa_github.pub pbcopy < ~/.ssh/id_rsa_bitbucket.pub ssh-add -D ssh-add id_rsa_github ssh-add id_rsa_bitbucket vim ~/.ssh/config #Github (personal) Host gh HostName github.com User git IdentityFile ~/.ssh/id_rsa_github #Bitbucket (work) Host bb HostName bitbucket.org User git IdentityFile ~/.ssh/id_rsa_bitbucket Config git config --global user.email "onmyway133@gmail.com" git config --local user.email "onmyway133bitbucket@gmail.com" Read more https://medium.com/avocoders/github-and-bitbucket-accounts-in-a-same-pc-5f8c67fd89d2 https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config Updated at 2020-10-04 06:52:07...

November 22, 2019 路 1 min 路 Khoa Pham

Useful git commands for everyday use!

Issue #239 Do you know that questions about git get the most views on StackOverflow? I鈥檝e searched a lot on Google how to execute certain actions with git, and this actually slowed me down a lot. There are some actions that we tend to use a lot, so it鈥檚 good to learn them. Here are my favorites, learning from friends and internet, hope you find them useful. Before we begin, you should run git 鈥搗ersion to check your current git version, mine is 2....

May 15, 2019 路 7 min 路 Khoa Pham