Posts tagged: git

All posts with the tag "git"

008

compare _ branch to _ with ** cli

1 min

006

Setup ** for _

1 min

005

** setup is _

1 min

Today I learned `git diff feature..main`

Today I learned how to diff between two branches.

git diff feature..main

Sometimes we get a little git add . && git commit -m "WIP" happy and mistakenly commit something that we just can’t figure out. This is a good way to figure out what the heck has changed on the current branch compared to any other branch.

Let’s create a new directory, initialize git and toss some content into a readme.

...

2 min read
git

git push without setting upstream

Finally after years of hand typing out a full git push --upstream my_really_long_and_descriptive_branch_name I found there is a setting to automatcally push to the current branch. More realisitically I just did a git push let git yell at me, and copying the suggestion.

git config --global push.default current

This one setting will now git push to the current branch without yelling at you that your upstream does not match your current branch. This helps me ship chnages faster as I am constantly chnaging projects and branches.

1 min read

Realistic Git Workflow

My git workflow based on real life. Its not always clean and simple.

sometimes things get messy

pull 👉 branch 👉 format 👉 work👉 add 👉 commit 👉 pull 👉 rebase 👉 push

...

7 min read
git

Rewrite History with Git

git reset -- <file>

rage unstage to wipte out history of staged commit

git reset --hard <file>

Undo file #

  • rage quit
  • git reset HEAD~n
    • removes modifications
    • keeps hitsory of changes and undoes them
  • git checkout HEAD~n –
    • keeps modifications

      removes history

      ...

1 min read
git

Update Git User

This morning I log into my VCS and check activity on my projects to find that someone else has been very active on my projects fo the last few weeks. I quicklyhover over the missing avatar to find that It’s Me. What’s wrong here, why do I look like two different people throughout the day! upon further investigation I see the issue. while setting up a new terminal environment I mistyped my email address by one character. After much searching and a few failed attempts I was able to fix it by following an article no longer available (2021) from https://help.github.com/articles.

Clone the repo, note it must be a --bare clone.

git clone --bare https://github.com/user/repo.git cd repo.git

git-author-rewrite">git-author-rewrite #

Curl down the git-author-rewrite script and edit the following variables...

...

1 min read
git