Git Commands Flashcards
git log
Displays all the commits, history along with commit hash, who committed and the date and time of commit
git log –oneline
Just shows commit hash and commit message
git log –name-only
Shows git log information with list of files that were changed in that commit
git log –author=’max’
list commits only from this author max
git log -1
only list the last commit, the most latest one
git checkout -b sarah
Create a new branch and checkout to that branch
git checkout sarah
switch to an existing branch
git branch -d max
To delete a branch
git branch
Command to list all branches
What is HEAD in git repository?
HEAD is where you are right now in the git reposito
git log –graph –decorate
to see the graphical view of how the branches were created like from which branch to which branch
git remote add origin http://git.example.com/sarah/story-blog.git
To add a remote repository for a local repository
git push origin master
to push your local repository changes to the origin which is your remote repository
git pull origin master
git fetch origin master