Skip to content
September 20, 2026
  • Bluesky
  • Facebook
  • Linkedin
  • Mastodon
  • RSS
  • Twitter
  • Youtube

Daily CyberSecurity

Zero-hour alerts. Unmatched analysis.

Primary Menu
  • Home
  • CVE Data
    • CVE Watchtower
    • Top Exploited CVEs
    • CVE Stats by Vendor
    • Q2 2026 Report
    • CVE Alerts
    • CVE Alert Settings
    • Pricing
  • Cyber Criminals
  • Data Leak
  • Free Tools
    • CVSS 3.1 Calculator
    • Certificate Viewer
    • DNS Lookup
    • Encoder & Hash Generator
    • IP / Subnet Calculator
    • Whois Lookup
  • Linux
  • Malware
  • Vulnerability
  • Submit Press Release
  • Weekly Recap
Light/Dark Button
  • Home
  • Technique
  • Some useful git commands
  • Technique

Some useful git commands

Do Son May 25, 2017 4 minutes read
git commands

In the case of project management with Git, there are some frequently encountered problems that are complicated to deal with. This article records some common commands and operations.

Modify the description of a submission

Sometimes we need to modify the description of the time before the submission of information, no operation can be done directly, but the use of rebasing command can be achieved.

For example, we want to modify the penultimate submission of the description information:

$ git rebase -i HEAD~3

Note: here HEAD ~ followed by 3 instead of 2, because here refers to the submission of the submitted parent to be modified.

And then will enter the text editing interface, as shown below

Will be modified to submit the previous pick to edit, save and exit.

This time to perform

$ git commit --amend

You can modify the description of the submission, modify and save and exit.

$ git rebase --continue

After the execution of this order, subsequent submissions will not change.

Note: Do not modify the commit that has been pushed to the remote repository! 

View, delete, rename remote branch

View all branches (including remote branches)

$ git branch -a

When a branch has been merged into the main branch, we usually delete the branch, if only git branch -d is to delete the local branch

To delete a remote branch, use the following command

$ git push origin --delete <branchName>

Renaming a branch is not very common, you can first delete the remote branch, and then rename the local branch, then rename the local branch pushed to the remote warehouse

$ git push --delete origin <branchName>

$ git branch -m <branchName> <newBranchName>

$ git push origin <newBranchName>

Merge multiple submissions

For example, to merge the last two submissions, in fact, and modify the information submitted a description of a bit similar.

$ git rebase -i HEAD~2

After the same will enter the text editing interface, the beginning of the second line of the pick to squash or s , save and exit.

At this time git will be submitted twice to merge and prompts you to enter the new submission information, save the exit after the successful completion of the merger of the two completed.

Force the remote repository back to the specified commit

When we develop some critical mistakes and make sure that the development work that is now done is meaningless, it may be necessary to roll back to the previous version.

$ git reset --hard <commit_id>

$ git push origin HEAD --force

In addition, the reset command has several optional parameters

  • Git reset – mixed: This is the default way, without any parameters git reset, instant this way, it back to a version, only to retain the source, return commit and index information.
  • Git reset – soft: roll back to a version, only back the commit information, will not return to the index file level. If you have to submit, you can directly commit.
  • Git reset-hard: completely back to a version, the local source will become the last version of the content.

Reset after reset-hard

Use git reset --hardafter, perhaps only to find it was a wrong action, then we want to revert to the previous version.

This time with git log is not seen before the submission of historical records.

You need $ git reflogto find the ID HEAD We need to restore, and then use the reset command to restore back.

View the contents of a specified file

For example, to see the contents of the test.cpp file submitted by f4869b0, the path to test.cpp needs to use the pathname relative to the git directory, using the following command:

$ git show f4869b0:test.cpp

The contents of the file will be displayed on the interface, you can use the file to redirect to another file, and then follow-up operation.

SHARE
Share on FacebookShare on XShare on LinkedInShare on TelegramShare on BlueskyShare on Mastodon
Tags: git git commands

Search

Translation

CVE ALERTS
📧

Email Delivery
Get threat intel straight to your inbox.

♾️

Unlimited Vendors
Track every technology in your stack.

🚨

All New CVE Alerts
Be the first to know about new flaws.

⚙️

Custom EPSS Threshold
Filter noise, focus on real risks.

💬

Slack & Teams Webhook
Integrate directly into your SecOps.

🚫

100% Ad-Free
Enjoy an uninterrupted reading experience.

$7/mo
Subscribe Now

🚨 Active Exploits in the Wild

  • CVE-2026-86124CVSS 9.8
    AutoAgent contains an unauthenticated remote code execution vulnerability in the TCP server that binds to all interfaces and...
    Admin intel📅 Updated: Sep 19, 2026
  • CVE-2025-39682CVSS 9.8
    In the Linux kernel, the following vulnerability has been resolved: tls: fix handling of zero-length records on the...
    CISA KEV📅 Added to KEV: Sep 18, 2026
  • CVE-2025-39964CVSS 7.8
    In the Linux kernel, the following vulnerability has been resolved: crypto: af_alg - Disallow concurrent writes in af_alg_sendmsg...
    CISA KEV📅 Added to KEV: Sep 18, 2026
  • CVE-2026-53266CVSS 8.8
    In the Linux kernel, the following vulnerability has been resolved: netfilter: bridge: make ebt_snat ARP rewrite writable The...
    CISA KEV📅 Added to KEV: Sep 18, 2026
  • CVE-2026-76460CVSS 10.0
    A vulnerability in an API of Cisco Identity Services Engine (ISE) could allow an unauthenticated, remote attacker to...
    Admin intelCISA KEV📅 Added to KEV: Sep 16, 2026📅 Updated: Sep 16, 2026
  • CVE-2026-89026CVSS 9.8
    The Issabel Framework, the web framework supporting Issabel PBX software, before commit b97dbaf contains a hard-coded HS256 JWT...
    Admin intel📅 Updated: Sep 16, 2026
  • CVE-2026-58704
    In Cellular Modem, there is a possible permission bypass due to a logic error in the code. This...
    Admin intelCISA KEV📅 Added to KEV: Sep 16, 2026📅 Updated: Sep 16, 2026
  • CVE-2026-87886
    Exploitation of this vulnerability has been detected in the wild in limited, targeted attacks against Acronis Backup plugin...
    Admin intelCISA KEV📅 Added to KEV: Sep 16, 2026📅 Updated: Sep 16, 2026
Powered by CVE Watchtower

Critical Vulnerabilities

  • CVE-2026-61516CVSS 9.8
    Netis NX10 firmware V4.0.1.5808 and V3.0.0.4142 contain an information disclosure vulnerability that allows unauthenticated attackers to retrieve the...
    📅 Updated: Sep 19, 2026
  • CVE-2026-81321CVSS 9.8
    CM2507 IP cameras store configured wireless network credentials in cleartext within the device filesystem. An attacker who obtains...
    📅 Updated: Sep 19, 2026
  • CVE-2026-75878CVSS 9.1
    IBM Sterling File Gateway could allow a remote attacker to bypass authentication and obtain a fully authenticated session...
    📅 Updated: Sep 19, 2026
  • CVE-2026-80441CVSS 9.8
    IBM Guardium Data Protection 12.2 is vulnerable to an unauthenticated second-order SQL injection vulnerability in the generateInsertQuery functionality...
    📅 Updated: Sep 19, 2026
  • CVE-2026-80442CVSS 9.9
    IBM Guardium Data Protection 12.2 is vulnerable to an authenticated OS command injection vulnerability in the exportCertificate functionality....
    📅 Updated: Sep 19, 2026
  • CVE-2026-82340CVSS 9.8
    IBM Guardium Data Protection 12.2 is vulnerable to unauthenticated insecure deserialization and attacker-controlled reflective method dispatch in the...
    📅 Updated: Sep 19, 2026
  • CVE-2026-82832CVSS 9.6
    IBM Guardium Data Protection 12.2 could allow a remote authenticated attacker to execute arbitrary code due to improper...
    📅 Updated: Sep 19, 2026
  • CVE-2026-82967CVSS 9.8
    IBM Guardium Data Protection 12.2 is vulnerable to an authentication bypass that allows an unauthenticated remote attacker to...
    📅 Updated: Sep 19, 2026
Powered by CVE Watchtower

Daily CyberSecurity

  • About SecurityOnline.info
  • Advertise with us
  • Announcement
  • Contact
  • Contributor Register
  • Login
  • Disclaimer
  • DCMA
  • Privacy Policy
  • About SecurityOnline.info
  • Advertise on SecurityOnline.info
  • Contact Us

When you purchase through links on our site, we may earn an affiliate commission. Here’s how it works

  • CVE Watchtower
  • CVE Statistics by Vendor 2026
  • Q2 2026 Report
  • Top Exploited CVEs
  • Bluesky
  • Facebook
  • Linkedin
  • Mastodon
  • RSS
  • Twitter
  • Youtube
© 2017 - 2026 Daily CyberSecurity. All Rights Reserved.