008
compare _ branch to _ with ** cli
All posts with the tag "git"
compare _ branch to _ with ** cli
Setup ** for _
** setup is _
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.
...
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.
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
...
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
Curl down the git-author-rewrite script and edit the following variables...
...
My original inspiration for this post came from steven ostermiller’s blog post that no longer exists from my last check in May, 2024.
https://blog.ostermiller.org/removing-and-purging-files-from-git-history/
I was able to find it on the way back machine though.
...