Squash commit
Info
Purpose: Combine N commit into one, and make it for new message
Reference resource
Method 1: rebase
with -i
flag
Tip
Change the secondary commit from
pick
tosquash
, save and continue for set new message for commit
Method 2: reset
with --soft
flag
Delete branch
Info
Follow the article to understand how we can remove the branch in local and remote, use
-d
flag at: Git Delete Remote Branch β How to Remove a Remote Branch in Git
For locally
You can use -d
with command git branch
For remote
You can use -d
with command push
Change commit contents
Info
When you want make a change inside your commit,
git
give us permission to handle it with--amend
and option attaching
Change author of commit
You can change author for commit with flag --author
with commit command
Change message
And you can take it with new message with flag --message
or -m
with commit amend
Tagging commit
Info
git
command support us release commit inside some repository platform, such asgithub
,gitlab
through using tagging with commit.
If you want explore more about this topic, here are some articles for you
Tagging one commit with annotate
When you want tagging in current commit, you can run tag
with -a
for annotate and -m
for message
If you want to specific commit, add commit SHA in last command above
Rename tagging for old tags
You can read the question - How do you rename a Git tag? to understand how can we handle this case
Force edit tagging
If you want to keep same context of tag, but change it to new commit or new message, you can handle it with -f
option with below command
Share tagging (release)
Info
You can handle share tagging with
push
command through two way
Push with both branch, and tagging
Or you can push only tag to remote
Note
Reason why we can, because your
tag
andbranch
will separate, and push same or not, itβs does matter
View Tagging
You can review your tag, content inside or what commit it attaching with through various commands