Showing posts with label Git. Show all posts
Showing posts with label Git. Show all posts

Thursday, September 18, 2025

Git repo - Hard Reset using TortoiseGit

Important Tip: 

Create a Backup Copy (zip file) of your local repo on your machine then . . .

This action discards all uncommitted changes in your working directory and aligns your branch's state with a specific commit. 

Because a hard reset is a destructive action, it's crucial to be certain you want to permanently discard your changes before proceeding. ⚠️

To perform a hard reset on a Git repository using TortoiseGit, you'll use the "Reset" option from the context menu. 


Step-by-Step Guide


  1. Right-Click on your Git-controlled folder to bring up the context menu.

  2. Navigate to TortoiseGit > Show log.This will open the reset dialog box.

  3. Select a Commit in the Repo, then Right Click on Reset "master" to this. . .  

  4. In the dialog box, you have two main options to configure the reset:

    • "To commit": This field allows you to specify the target commit to which you want to reset your branch. You can either type the commit hash, branch name, or a tag name directly into the box. Alternatively, you can use the ... button to open the log dialog and select the desired commit visually.

    • "Reset type": From the Dialog Options select "Hard Reset . . .". This is the key step. Choosing "Hard" will discard all your local changes (staged and unstaged) and move your branch's pointer to the selected commit. 

    • The other options, "Soft" and "Mixed," are less destructive and won't be covered here.

    • Once you've selected the correct commit and chosen "Hard" as the reset type, click "OK"..

After clicking "Yes," TortoiseGit will execute the hard reset, and your working directory will be reverted to the state of the selected commit. 

Example:  Hard Reset to remotes/origin/master

All files that were changed or added since that commit will be permanently deleted from your local copy. 

Sunday, May 12, 2024

Git - Skip-Worktree

If you have files that you do NOT want to Commit then . . . 

Assumiing you have TortoiseGit installed.

Windows File Explorer > Right Click on File > Show More options > Properties > Git Tab > Check Skip-Worktree > Apply > Ok > F5 to Refresh Displayed Files

The skip-worktree flag in Git is used to tell Git to exclude a specific file from the working directory whenever possible. 

This means:

Git will avoid writing the file to the working directory during operations like checkout, pull, or switch.

Git won't track changes made to the file, even if it's present in the working directory.

Git won't record the absence of the file in commits.

This flag is useful for configuration files or other files that should not be accidentally committed but might need to be edited locally sometimes.

Here's a table summarizing the key differences between skip-worktree and the similar flag assume-unchanged:

Use Cases for skip-worktree

Configuration Files: You might have environment-specific configuration files in your Git repository that shouldn't be committed but need to be modified locally for development.

Third-party Libraries: Large libraries included in your project can be marked with skip-worktree to avoid cluttering your working directory and improve performance.

Things to Consider

skip-worktree requires some manual work compared to assume-unchanged. If you need to make changes to the file, you'll have to manually add it back to the working directory before editing.

skip-worktree doesn't work with all Git commands. For instance, stashing won't work on files with this flag.

I recommend checking out the Git documentation on git-update-index for more details on the skip-worktree flag https://git-scm.com/docs/git-update-index. There are also resources online that discuss using skip-worktree for specific scenarios, like managing configuration files.

Google Gemini

Resources:

How To Fix Gitignore Not Working - Kinsta®

Git – Problem with “skip-worktree” and Pull - CodeProject

Ignoring Files with Git | Automation Panda

Warning: The skip-worktree setting applies only to the local repository. It is not applied globally! Each user will need to set the skip-worktree on their machine (PC).

Saturday, May 4, 2024

Git - Assume Unchanged

If you have files that you don't want to commit then . . . 

Assumiing you have TortoiseGit installed.

Windows File Explorer > Right Click on File > Show More options > Properties > Git Tab > Check Assume valid/unchanged > Apply > Ok > F5 to Refresh Displayed Files

Example

To undo Assume UnChanged . . . 

Windows File Explorer > Right Click on File > Show More options > Properties > Git Tab > UnCheck Assume valid/unchanged > Apply > Ok > F5 to Refresh Displayed Files

Resources: Ignoring Files with Git | Automation Panda

That's it !

Monday, March 25, 2024

Git - Overview

Git is a popular version control system (VCS) for software development projects. Unlike older systems, Git is a distributed system, which means every developer working on a project has a complete copy of the project history on their local machine. This allows for faster and more flexible collaboration.

Here's a quick rundown of what Git offers:

  • Tracks changes: Git keeps a record of all changes made to the code over time. This allows developers to see exactly what was modified, by whom, and when.
  • Collaboration: Multiple developers can work on the project simultaneously without stepping on each other's toes. Git's branching feature enables developers to isolate their changes and integrate them back into the main project seamlessly.
  • Non-linear development: With Git, developers can create branches to experiment with new features or bug fixes without affecting the main codebase. This allows for more flexible and efficient development workflows.

Here are some key concepts in Git:

  • Repository (repo): This is a central location where all the project files and their revision history are stored. It can be hosted on a platform like GitHub or be local to a team's machines.
  • Working directory: This is your local copy of the project files from the repository.
  • Staging area: This is a temporary holding area where you designate specific changes to be included in your next commit.
  • Commit: This is the act of capturing a snapshot of the project's state at a particular point in time, along with a descriptive message.

If you're new to Git, there are many resources available online to help you get started, including tutorials, documentation, and interactive courses. https://git-scm.com/docs/gittutorial

Saturday, January 13, 2024

git: 'credential-manager-core' is not a git command.

Solution:

Open .gitconfig and delete two lines then save .gitconfig

[credential]

    helper = manager-core

C:\Users\UserName\.gitconfig











That's it !

Sunday, February 6, 2022

Git LFS

For faster Git Bucket pulls use LFS ?

LFS us Not Recommneded for use with Altium Git Repos ! ! !

https://www.atlassian.com/git/tutorials/git-lfs#installing-git-lfs

That's it !

Sunday, February 14, 2021

Git Parts for Altium Libraries

The latest release of Parts supports Git repositories.




User's can create remote library solutions using Altium 365 and TortoiseGit.

YouTube Video Link: https://youtu.be/cOSNSMVSAeo

Steps: 

Sign in to your Altium 365 Workspace

Download Parts or start your own project

Make the Project Available Online and to Version Control.

click on image to view

Save the changes to the Server.

To use TortoiseGit 

Install TortoiseGit, then browse the local library project repo, enter your Altium Credentials when prompted.

Using TortouiseGit add and commit Schlib and PcbLib files to Symbols and Footprint Folders.

That's it !