git functions Flashcards
split last unpushed commit into several commits
git reset HEAD~ -> build commits anew
force push branch
git push -f
combine multiple commits into one
git rebase -i HEAD~(NoOfCommitsFromLast)
git rebase -i “revision number”^
show last x commits
git log -n x
delete local branch
git branch -d “branchname”
create new git repository
git init –bare –shared
copy remote git repository to local
git clone
Move commit from one branch to another
- get git hash of commit through git log
- move to branch without commit
- git cherry pick commit hash
- revert other branch to commit before
what are the three trees in git?
HEAD
Index
Working directory
in git, what is HEAD?
A Pointer, that points to the currently checked out branch, and through that the last commit on the branch
in git, what is the INDEX?
The staging area
how does one get the git hash of a compiled executable?
“executable” –program-version