Committing changes

What has been changed?

Add only parts of file to stage

When using the above command, the hulks are somethimes too big and the edit hulk option too difficult to handle. I therefore prefer git gui [source]:sudo apt-get install git-guijust run this command before staging changes:git gui

Moving untracked changes to stash

When you want to apply a merge or update your repository and you get the following message: „error: Your local changes to the following files would be overwritten [..] Please, commit your changes or stash them before you can merge.“ This is how to use stash:git stashgit stash listgit stash apply

Modify commits

git rebase -i HEAD~3..where 3 is the number of commits you have to go back for the commit you want to split. The number can also be higher. You get into an edit mode where you see the last commits with the prefix „pick“. Change that to „edit“ for the commit you want to split.