Git command yang paling sering digunakan

  • List all local branches:
    git branch

    This command will show all local branches, with the current branch highlighted.

  • List branches with recent commits: To see the most recently active branches along with the last commit on each, you can use:
    git branch --sort=-committerdate --format="%(refname:short) - %(committerdate:relative)"

    This will list the branches sorted by the last commit date, showing how long ago the last commit was made.

  • List recently checked-out branches: To show branches that have been checked out recently (useful to see your working history):
    git reflog

    This will display a log of all your recent Git actions, including branch checkouts. You can look for checkout actions to see which branches you’ve been switching between.













Leave a Reply

Your email address will not be published. Required fields are marked *