Git
Cara cepat dan mudah push ke current branch
According to git push documentation : git push origin HEAD A handy way to push the current branch to the same name on the remote.
Cara ganti username & email git
git config --global user.name "Wayan Jimmy"git config --global user.email "jimmyeatcrab@gmail.com"
Cara menggabungkan beberapa commit menjadi 1 commit (squash merge)
git checkout mastergit merge --squash bugfixgit commit
https://stackoverflow.com/questions/5308816/how-to-use-git-merge-squash
Error: bad index – Fatal: index file corrupt
rm -f .git/indexgit reset
Short git status
git status -s
Delete multiple branches using a pattern
gb | rg 'put-pattern-here-' | xargs git branch -D
Git Branches
Git commit contains pointer to the snapshot of the content you staged. This object also contains the author’s name and email address, the message that you typed, and pointers to the commit or commits that directly came before this commit (it's parent or parents)
zero parents for the initial commit
one parent for normal commit, and multiple parents for a commit that results from a merge of two or more branches.
Better Diff
GitHub - so-fancy/diff-so-fancy: Good-lookin’ diffs. Actually… nah… The best-lookin’ diffs.
How to Write a Git Commit Message
The 7 rules of great Git commit message
- Separate subject from body with a blank line
- Limit the subject line to 50 characters
- Capitalize the subject line
- Do not end the subject line with period
- Use the imperative mood in the subject line
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how
Git at 15: How Git Changed the Way We Code
But git approaches the task a bit differently than most Version Control Systems. Most systems store information as a list of file-based changes, so both the file and the changes made to the file over time is stored. Git, on the other hand, looks at data as a series of snapshots on a miniature filesystem.
Links
- Commit Lint
- Git Explorer
- Gitlab Training
- Github gists from command line
- Forgit: using git interactively
- Tech Talk: Linus Torvalds on git
- Karma git commit message pattern
- How to Write a Git Commit Message
- The mind behind Linux | Linus Torvalds
- Gitlet, your own version-control system
- Git at 15: How Git Changed the Way We Code
- SHOULD READ https://git-scm.com/book/en/v2
- Good commit message for contributing to Go project
- How the Internet will (one day) transform governmenta
- How to Write Good Commit Messages: A Practical Git Guide
- https://twitter.com/flexdinesh/status/1215119465068675072
- "LOTS of People Have IDEAS. Can You EXECUTE YOURS?" - Linus Torvalds - Top 10 Rules
- SHOULD READ https://owenou.com/ten-things-you-didnt-know-git-and-github-could-do
#git #github #gitlab #linus