Pronoy Chopra

Pronoy Chopra

Developer/Engineer

© Pronoy Chopra 2020

Theme: plainwhite

Some GIT stuff I keep forgetting

Some git stuff I use often but for some reason I keep forgetting

Setting per repo config

 [core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
	ignorecase = true
	precomposeunicode = true
[remote "origin"]
	url = repo_url.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[user]
	name = Pronoy Chopra
	email = [email protected]
[credential]
	helper =
[branch "master"]
	remote = origin
	merge = refs/heads/master

Undo git add

git reset <filename>

Amend a commit

git commit --amend

Undo the last commit and keep changes

git reset --soft HEAD~1

I’ll obviously keep updating it as I find myself forgetting more things