programming.dev
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
codeinabox to GitEnglish · 2 months ago

Use skip-worktree to ignore modified files

www.brandonpugh.com

external-link
message-square
0
link
fedilink
6
external-link

Use skip-worktree to ignore modified files

www.brandonpugh.com

codeinabox to GitEnglish · 2 months ago
message-square
0
link
fedilink
Today I learned about the --skip-worktree command in git which will treat a file like it hasn’t been modified. This is useful if you have to modify a file locally but don’t ever want to commit it (config files are a common scenario). Like me, you may have seen --assume-unchanged used in this way but that’s not what it’s meant for since it’s “designed for cases where it is expensive to check whether a group of files have been modified”. As a result you’re likely to lose the changes you have made to those files. This post shows a good summary of the outcomes of common operations with each command.
alert-triangle
You must log in or # to comment.

Git

git

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Resources

  • Official Git project site
  • Pro Git book

Rules

  1. Follow programming.dev rules
  2. Be excellent to each other, no hostility towards users for any reason
  3. No spam of tools/companies/advertisements. It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.

Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 1 user / week
  • 93 users / month
  • 320 users / 6 months
  • 993 local subscribers
  • 4.04K subscribers
  • 288 Posts
  • 1.07K Comments
  • Modlog
  • mods:
  • Ategon
  • canpolat
  • Jason Novinger
  • BE: 0.19.13
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org