Course site for "Experimental Psychology Lab" 2019
mkdir my_first_git
cd my_first_git && git init
mynotes.md
to the directorygit status
git add mynotes.md
git status
againgit commit -m "my first commit"
git status
againgit log
mynotes_2.md
mynotes.md
git status
git diff mynotes.md
to see changes between last commit & current versiongit diff mynotes.md
againgit diff COMMIT-1 COMMIT-2 mynotes.md
git log
)mynotes.md
with git diff mynotes.md COMMIT-1 COMMIT-2 -- mynotes.md
git log -p mynotes.md
to get a full change history of file mynotes.md
mynotes.md
git add mynotes.md
git status
(boring!)git reset mynotes.md
git status
againgit checkout mynotes.md
to undo your recent local changesgit reset --hard
to undo all local changesgit log --oneline
git checkout FIRST-COMMIT-ID
to roll back complete to where you were in the beginninggit branch silly_try
git checkout silly_try
mynotes.md
git commit -a -m "changes to a branch"
git log --graph --oneline --all
git checkout master
git merge silly_try
git commit -a -m "merged in branch silly_try"
git log --graph --oneline --all
master
mynotes.md
silly_try
mynotes.md
master
silly_branch
into master
git merge silly_branch
mynotes.md
and fix the conflict manuallygit remote add origin YOUR-REPO-URL
origin
is the name for your remote repo