forked from kontur-courses/git-rules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
John Doe
committed
Oct 8, 2021
1 parent
f763f5f
commit 24be26a
Showing
5 changed files
with
160 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[merge] | ||
tool = vscode | ||
[mergetool] | ||
keepbackup = false | ||
[diff] | ||
tool = vscode | ||
guitool = vscode | ||
[core] | ||
autocrlf = input | ||
[pull] | ||
ff = only | ||
rebase = false | ||
[fetch] | ||
prune = false | ||
[rebase] | ||
autoStash = false | ||
[difftool "vscode"] | ||
path = code | ||
cmd = code --wait --diff $LOCAL $REMOTE | ||
[mergetool "vscode"] | ||
path = code | ||
cmd = code --wait $MERGED | ||
[credential] | ||
helper = manager | ||
[alias] | ||
it = !git init && git commit -m 'Initial commit' --allow-empty | ||
st = status -sb | ||
call = !git add . && git commit -m | ||
commend = commit --amend --no-edit | ||
graph = log --oneline --decorate --graph --all | ||
to = checkout | ||
pushup = push -u origin HEAD | ||
please = push --force-with-lease | ||
puff = pull --ff-only | ||
pure = pull --rebase --autostash | ||
undo = reset --soft HEAD^ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[merge] | ||
tool = vscode | ||
[mergetool] | ||
keepbackup = false | ||
[diff] | ||
tool = vscode | ||
guitool = vscode | ||
[core] | ||
autocrlf = true | ||
[pull] | ||
ff = only | ||
rebase = false | ||
[fetch] | ||
prune = false | ||
[rebase] | ||
autoStash = false | ||
[difftool "vscode"] | ||
path = code | ||
cmd = code --wait --diff $LOCAL $REMOTE | ||
[mergetool "vscode"] | ||
path = code | ||
cmd = code --wait $MERGED | ||
[credential] | ||
helper = manager | ||
[alias] | ||
it = !git init && git commit -m 'Initial commit' --allow-empty | ||
st = status -sb | ||
call = !git add . && git commit -m | ||
commend = commit --amend --no-edit | ||
graph = log --oneline --decorate --graph --all | ||
to = checkout | ||
pushup = push -u origin HEAD | ||
please = push --force-with-lease | ||
puff = pull --ff-only | ||
pure = pull --rebase --autostash | ||
undo = reset --soft HEAD^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Коллекция полезных .gitignore от GitHub: https://github.com/github/gitignore | ||
|
||
# Игнорирование всех markdown-файлов: | ||
*.md | ||
|
||
# Исключение из игнорирования конкретного файла: | ||
!init.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
git config --local include.path "../.gitconfig-for-nix" | ||
|
||
# setting editor for commits | ||
git config --local core.editor nano | ||
|
||
# setting anonymous name and email if not configured by user | ||
GitUserEmail=$(git config --get user.email) | ||
if [[ "$GitUserEmail" == "" ]]; then | ||
git config --local user.email "[email protected]" | ||
fi | ||
GitUserName=$(git config --get user.name) | ||
if [[ "$GitUserName" == "" ]]; then | ||
git config --local user.name "John Doe" | ||
fi | ||
|
||
echo "Configuration is done" | ||
sleep 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
@echo off | ||
|
||
set GIT=git | ||
|
||
%GIT% --help > nul | ||
|
||
if %errorlevel% neq 0 ( | ||
set GIT="%ProgramFiles%\Git\bin\gi.exe" | ||
) | ||
|
||
%GIT% --help > nul | ||
|
||
if %errorlevel% neq 0 ( | ||
color 0c | ||
echo. | ||
echo. | ||
echo "Git is not configured properly... Ask for help!" | ||
pause | ||
exit | ||
) | ||
|
||
REM setting editor for commits | ||
%GIT% config --local core.editor notepad | ||
|
||
REM including predefined config | ||
%GIT% config --local include.path "../.gitconfig-for-win" | ||
|
||
REM setting up absolute path to visual studio code | ||
if exist "%ProgramFiles(x86)%\Microsoft VS Code\Code.exe" ( | ||
%GIT% config --local difftool.vscode.path "%ProgramFiles(x86)%\Microsoft VS Code\Code.exe" | ||
%GIT% config --local difftool.vscode.cmd "%ProgramFiles(x86)%\Microsoft VS Code\Code.exe --wait --diff $LOCAL $REMOTE" | ||
%GIT% config --local mergetool.vscode.path "%ProgramFiles(x86)%\Microsoft VS Code\Code.exe" | ||
%GIT% config --local mergetool.vscode.cmd "%ProgramFiles(x86)%\Programs\Microsoft VS Code\Code.exe --wait $MERGED" | ||
) | ||
if exist "%ProgramFiles%\Microsoft VS Code\Code.exe" ( | ||
%GIT% config --local difftool.vscode.path "%ProgramFiles%\Microsoft VS Code\Code.exe" | ||
%GIT% config --local difftool.vscode.cmd "%ProgramFiles%\Microsoft VS Code\Code.exe --wait --diff $LOCAL $REMOTE" | ||
%GIT% config --local mergetool.vscode.path "%ProgramFiles%\Microsoft VS Code\Code.exe" | ||
%GIT% config --local mergetool.vscode.cmd "%ProgramFiles%\Programs\Microsoft VS Code\Code.exe --wait $MERGED" | ||
) | ||
if exist "%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe" ( | ||
%GIT% config --local difftool.vscode.path "%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe" | ||
%GIT% config --local difftool.vscode.cmd "%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe --wait --diff $LOCAL $REMOTE" | ||
%GIT% config --local mergetool.vscode.path "%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe" | ||
%GIT% config --local mergetool.vscode.cmd "%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe --wait $MERGED" | ||
) | ||
|
||
REM setting anonymous name and email if not configured by user | ||
for /f %%i in ('git config --get user.email') do set GitUserEmail=%%i | ||
|
||
if [%GitUserEmail%] == [] ( | ||
%GIT% config --local user.email "[email protected]" | ||
) | ||
|
||
for /f %%i in ('git config --get user.name') do set GitUserName=%%i | ||
|
||
if [%GitUserName%] == [] ( | ||
%GIT% config --local user.name "John Doe" | ||
) | ||
|
||
echo Configuration is done | ||
pause |