Skip to content

Latest commit

 

History

History
58 lines (53 loc) · 1.59 KB

File metadata and controls

58 lines (53 loc) · 1.59 KB

git tag [tag name]

git tag

shows all tag names

git tag [tag name]^

refers to parent of tag

git revert HEAD [file name]

cancel commits

git checkout [file name]

abandons changes in file since last commit

git reset --hard

git tag -d

delete tag

git hist --max-count=1

displays latest commit

git hist master --all

displays all commits

git commit --amend -m "comment"

ammend commit comment

mkdir [folder name]

make folder

git mv [file name] [folder name]

copy file into folder

ls -C .git

displays files in project's root directory

ls -C .git/objects

generates a directory list The directory names are the first two letters of the sha1 hash of the object stored in git

ls -C .git/objects/[dir]

display files that contain objects stored in git

cat .git/config

display contents of project-specific configuration file

ls .git/refs

ls .git/refs/heads

ls .git/refs/tags

cat .git/refs/tags/v1

cat .git/HEAD

references current branch

git checkout -b [branch name]

creates new branch

git checkout [branch name]

switch to existing branch

git merge master

merge files/current branch into master branch

git hist --all

displays all commits

git push -u origin [branch name]

push changes in current branch into another branch on Github

git push origin master

send changes back up to forked repo on Github

git push

push changes in current branch into repo on Github

git remote add [remote name] [git repo name].git

add location to push respo changes into