Skip to main content

Practical Git Commands

 Revert Git Repo to a previous Tag:


    1. reset to a tag named reset-to-here

    git reset --hard reset-to-here

    2. push your change to the remote forcing by +

    git push origin +main

 

Push Tag to Remote: 

To push a single tag:

git push origin tag <tag_name>

And the following command should push all tags (not recommended):

# not recommended
git push --tags

 

Comments

Popular posts from this blog

Cost Optimization Use Cases for AWS S3 Tables (Iceberg) in Analytics Solutions

AWS S3 Tables with Apache Iceberg integration represents a significant advancement in data lake technology that can dramatically reduce costs for analytics solutions. The implementation of Iceberg in AWS S3 has demonstrated remarkable cost savings of up to 90% in some deployments, primarily by addressing small file problems, optimizing storage efficiency, reducing API request costs, and improving query performance. Key use cases that benefit most include high-volume data lakes suffering from small file proliferation, analytics solutions requiring frequent schema changes, systems with repetitive query patterns on common datasets, and applications needing advanced features like ACID compliance and time travel capabilities. Organizations can leverage these capabilities to not only reduce their direct storage costs but also decrease associated compute expenses, streamline data engineering workflows, and build more cost-effective modern data architectures. Understanding S3 Tables and Apache...

Mastering curl: Efficiently Handle Cookies and CSRF Tokens for Seamless POST Requests

In many scenarios, you might need to handle cookies in your curl requests and use those cookies in subsequent requests. For example, you might need to get a CSRF token from the initial request and include it in the body of a subsequent POST request. Here’s a step-by-step guide on how to achieve this using curl . Step-by-Step Guide Get the Headers and Save Cookies: First, you need to get the headers from the initial request and save the cookies to a file. This can be done using the -I option to fetch headers and -c to specify the cookie file. sh Copy code curl -c cookies.txt -I http://example.com This command will save the cookies from http://example.com into a file named cookies.txt . Extract the CSRF Token: Next, you need to extract the csrf_token cookie value from the cookies.txt file. This can be done using grep and awk : sh Copy code CSRF_TOKEN=$(grep 'csrf_token' cookies.txt | awk '{print $7}' ) This command finds the line containing csrf_token in cookies....

Identifying AWS Service and Region from a Given IP Address: A JavaScript Solution

  In today's digital age, managing cloud resources efficiently is critical for businesses of all sizes. Amazon Web Services (AWS), a leading cloud service provider, offers a plethora of services spread across various regions worldwide. One of the challenges that cloud administrators often face is identifying the specific AWS service and region associated with a given IP address. This information is vital for configuring firewalls, setting up VPNs, and ensuring secure network communication. In this blog post, we will explore how to identify the AWS service and region for a provided IP address using the AWS-provided JSON file and a simple JavaScript solution. This approach will help you streamline your cloud management tasks and enhance your network security. The Problem: Identifying AWS Services and Regions AWS provides a comprehensive range of services, each operating from multiple IP ranges across different regions. These IP ranges are frequently updated, and keeping track of them...