• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Twitter GitHub
You are here: Home / Archives for Git

Git

Git Preview Changes in Commit Message

Last updated on January 14, 2020 by Sal Ferrarello

You can set Git to preview all of the changes in your commit when you write your commit message. I find this to be a big help in writing my commits (and reminds me to keep the changes in my commits small).

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Recommendations Tagged With: Git, gitconfig

git switch

Last updated on October 6, 2020 by Sal Ferrarello

Git version 2.23.0 is introduced a new command ‘git switch’. This command does a subset of what ‘git checkout’ does (because ‘git checkout’ does so many different things).

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Draft Tagged With: Git

git restore

Last updated on October 6, 2020 by Sal Ferrarello

Git version 2.23.0 is introduced a new command ‘git switch’. This command does a subset of what ‘git checkout’ does (because ‘git checkout’ does so many different things).

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Draft Tagged With: Git

Git Diff Ignore Mode Changes

Last updated on November 18, 2019 by Sal Ferrarello

When the permissions on a file change in a commit, Git will include this in the diff. Git refers to this as a mode change. When I’m looking at a “git diff” (or specifically a “git diff –name-only” where I’m looking for a list of files that have been changed), I often want to ignore mode changes (a.k.a. permission changes). By adding “-G.” to the command, mode changes will be ignored.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Git

git warning: path is unmerged

Last updated on August 30, 2019 by Sal Ferrarello

Sometimes after running git stash pop, I get a conflict warning and I want to discard any changes to a file. However, when I try to checkout the file I get an error message. Using reset and then checkout, lets me accomplish this goal.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Solution Tagged With: Git

Boy looking through binoculars.

View Current Commit Message during Git Rebase Conflict

Last updated on January 17, 2021 by Sal Ferrarello

When I do a git rebase and I get a conflict, I can use git log to see all the commits rebased thus far. However, I often get confused about what the current (incomplete) commit is that caused the conflict. It would be super helpful if I could see the commit message of the current commit. This command allows you to view the current (incomplete) commit during a rebase.

Filed Under: Dev Tips, Solution Tagged With: Git, rebase

Git Previous Branch

Last updated on February 11, 2019 by Sal Ferrarello

When working with Git on the command line, I spend a lot of time switching back and forth between two branches. Even with Git tab completion, it is a lot of typing. However Git has a shortcut for the previous branch, a single dash (-).

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Recommendations Tagged With: command line, Git

Get a File from Another Git Branch

Last updated on February 7, 2019 by Sal Ferrarello

I was working on one Git branch and I wanted a file from another branch. Using git checkout, we can do this.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Git

How is git push force-with-lease aware of a commit

Last updated on January 21, 2019 by Sal Ferrarello

I’ve written about using “git push –force-with-lease” instead of git push –force” because “force-with-lease” will only force push changes if your local copy is aware of all of the commits on the remote branch but how is git “aware” of the commits.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft Tagged With: Git

A bulldozer.

Never use git push force

Last updated on January 29, 2021 by Sal Ferrarello

Never use git push –force. Seriously, don’t use it. You should always use –force-with-lease instead. We’ll look at the problem with –force and how –force-with-lease addresses the issue.

Filed Under: Dev Tips, Recommendations Tagged With: Git, git alias

  • «Previous Page
  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Go to page 5
  • Next Page»

Copyright © 2021 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in