- Use powershell to execute following commands
- after each git command use
git log --oneline --decorateandgit status, to ensure, what is the current state. git cleanis called because merge tool may create backup files, so we need to remove them from disk.- notepad++ or eny other tool can be used instead of KDiff3
NOTE: Keep in mind to execute them from correct directory!
md C:\GitTests\server
md C:\GitTests\clientA
md C:\GitTests\clientBgit init --baregit init
git commit --allow-empty -am "First commit"
git remote add origin '\\localhost\c$\GitTests\server\'
git remote --v
git push --set-upstream origin master
git log --oneline --decorateget-content .git\config
git config -l # list options
git config --add core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
git config --edit
# add lines:
[user]
name = Jiri Pokorny
email = jirka@wug.cz
[credential]
helper = manager
[merge]
tool = kdiff3
[mergetool "kdiff3"]
path = C:/Program Files/KDiff3/kdiff3.exe
trustExitCode = false
[diff]
guitool = kdiff3
[difftool "kdiff3"]
path = C:/Program Files/KDiff3/kdiff3.exe
trustExitCode = false
[difftool]
prompt = false
[mergetool]
keepBackup = falseecho "" >> .gitignore
git add .\.gitignore
git commit -am "added gitignore"
git pushecho "first" >> readme.md
git add .
git status --short
git commit -m "first wrong"
git log --oneline --decorate
git commit --amend
git pushgit clone \\localhost\c$\GitTests\server .
echo "two" >> readme.md
git commit -am "two"
git pushgit fetch -p
git log --decorate --oneline --allgit checkout -b featureA
git branch
git branch -vv
echo "three" >> .\readme.md
git commit -am "three"
git log --decorate --graph --oneline --allgit fetch origin master:master
git merge master
git mergetool .\readme.md
git clean -xdf
git commit -m "merge from master"
git log --decorate --graph --oneline --all
git push --set-upstream origin featureAgit checkout -b featureA
echo "four" >> .\readme.md
git commit -am "four"
git log --decorate --graph --oneline --all
git branch -r
git branch -u origin/featureA featureA
git pull
git mergetool .\readme.md
git clean -xdf
git commit -m "merge from clientA"git reset head~
git checkout .git pull --rebase
git mergetool .\readme.md
git clean -xdf
git status
git rebase --continue
git log --decorate --graph --oneline --allgit stash help
echo "five" >> .\readme.md
git stash
git stash show 'stash@{0}'
git stash apply 'stash@{0}'
git stash drop 'stash@{0}'git tag -a v1.0 -m "version 1.0" head~3
git push --tagsgit fetch
git tag -d v1.0
git push -d origin v1.0- interactive rebase to fix commit
- remove/rename branch
- i did a commit, but forgot to create branch (detached head)