2 Git - rciak/zz_42_shared_notes GitHub Wiki
- Git Tutorials on W3 Schools
- A game to learn git.
Install the program meld
and link it to git as described here.
Remark: Many of the following commands can be followed by a list of files making them more selective ...
-
See the changes made since the last
git add
git status
git difftool
-
Preparing more organized or even atomic commits: Add only selected changes
git add -p
-
Continue coding more / repeat 2. until commit is ready
-
More secure commiting: See all the changes that have been added so far:
git difftool --staged
git commit
git branch
git branch new_branch
-
git checkout new_branch
:
: -
git checkout main
(or other branch in which we want to merge) git merge new_branch
-
git log --graph --all --oneline *or*
git log --graph --decorate=short --all --oneline --color | less -R -X*or*
git log --graph --decorate=short --all --oneline --color | less -R -X | head -17` -
git checkout <commit ID>
-
git checkout main
(if you want to return to the main branch afterwards)
-
git ls-files
-
git revert
andgit revert --abort
-
git difftool <commit ID1> <commit ID2>
-
git stash
andgit stash pop