Show History of Changes to Specific File with Git
I am always having to google this to find the correct command.
I often need to see a history of changes to a specific file.
The best command I have found for this so far is:
git log -p [filename]
Selective Git Add
git add -u
This git command looks at the already tracked files and stages the changes to those files if they are different or have been removed...
I found this command when I had a lot of modified files and a good handful of new files, but only wanted to
Git --assume-unchanged Problem When Switching Branches
I had a problem switching to a different branch when using git --assume-unchanged. I've been using this command as a lazy git ignore and found it quite useful.
However, I recently tried to switch a branch when I had marked a config file --assume-unchanged and had…
Super Simple Git Submodule Guide
Hopefully you already have some idea what a git submodule is, but if not:
It often happens that while working on one project, you need to use another project from within it. Perhaps it’s a library that a third party developed or that you’re developing separately and…
How to Merge Two Git Repositories
So I've switched this site from our friend Wordpress to a flat file CMS based site... There a few reasons why I decided to do this, but largely I did it for fun!
I love me some git and wanted to preserve the git history of…
Set up web based git workflow
You cannot push to a live working directory - throws errors and can cause many issues. Therefore need to set up a more complex git setup.
Here are the steps
NB you'll need terminal / ssh access to the web server
Set up website as standard in…
Git Remote Branches
Git is awesome, no question and the more I use it the more confident I am with it and generally happy with the world I am!
If you want to pull a branch into your repository from a remote one (not necessarily the origin of the one you're working…
Git Branch Notes
Simple list of git branch commands for reference:
List current branches:
$ git branch
Create a new branch:
$ git branch branchname
where branchname is name of your choosing
To switch to your new branch:
$ git checkout branchname
To merge branches back, switch to the master branch then:
$ git merge branchname
Or to delete the
Open all files from a specific Git Commit in Vim
I occasionally find myself needing to open all files from a specific Git commit. I use vim as my editor.
I created a little alias to get all the names of files modified in the specific commit and open them all in