Jonathan Pepin

My Git personal journal

remove a file

Deletes the file and removes it from the git tracking at the same time.

add all the removed files

$gitadd-u

Add all deleted files at once instead of doing git rm /file/name for each file

amend

$gitcommit--amend

Insert a forgotten change to the last commit, so you don't have to make a new commit for a quick addition.

branch

rename a branch

$gitbranch-moldnamenewname

push to origin.(will create the remote branch if it doesn't already exist)

$gitpushoriginbranchname

Remote actions

get info on all locals and remote branches

gitremoteshoworigin

rebase

$gitrebaseorigin/master

Like pull but puts local commits on the side for the update, then merge the local commits, making merges conflicts about the addition of the local changes, versus the addition of origin's changes on top of local.

$gitrebase-i

Allows to merge multiple commits in one, so you make cleaner pushes to origin and keep a clean local logs.