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

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 March 18, 2023 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

Git HEAD~ vs HEAD^

Last updated on January 7, 2019 by Sal Ferrarello

Both HEAD^ and HEAD~ can be used in Git to refer to previous commits but in different ways.

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

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

Git Commit Message Editor

Last updated on January 14, 2020 by Sal Ferrarello

By default Vim is the editor used when writing a Git commit message. While I love Vim, it does work very differently than most other editors. A good option for those who are not comfortable with Vim, is to use a different editor. This is how to setup Git to use a different editor.

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

Filed Under: Computing, Dev Tips, Draft, Programming, Recommendations, Solution Tagged With: Git, gitconfig, nano, Visual Studio Code

Screenshot of Git Log and Git Rebase Interactive showing in one case the newest commit is at the top and in the other case the newest commit is at the bottom.

Git Interactive Rebase Order is Wrong

Last updated on January 14, 2019 by Sal Ferrarello

The interactive rebase feature of Git is one of my favorites. I love being able to squash multiple commits into one commit or re-order my commits for clarity. My one complaint is the Git interactive rebase commit order is wrong (at least for the way my brain works).

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

Git Delete Merged Branches

Last updated on January 29, 2021 by Sal Ferrarello

When using Git, sometimes (often) I find myself forgetting to delete local branches after merging them. This command deletes this branches (and I’ve included a Git alias to make it easy to use in the future).

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

Filed Under: Computing, Draft, Programming, Solution Tagged With: Git, git alias

  • «Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 3
  • Go to page 4
  • Go to page 5
  • Go to page 6
  • Go to page 7
  • Next Page»

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