-
Notifications
You must be signed in to change notification settings - Fork 0
/
recipes.txt
49 lines (39 loc) · 1.54 KB
/
recipes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
git remote add <remoteRepositoryName> <url>
команда для добавления на удаленный репозиторий
git pull origin master --allow-unrelated-histories
git push origin master
// открыть с помощью VSC
code file.txt
code ../directory
// чтобы влить все изменения из любой (master) ветки в 1234-bug-login
git checkout 1234-bug-login
git rebase dev
git push -f origin 1234-bug-login
// Для красивого вывода истории в консоль
git log --oneline --decorate --graph --all
// Рецепт по передвижению ветки в ручную
git checkout <branchName>
git branch -f <branchName> <otherBranch|commitHash>
-- короткая запись, которая сама перейдет на другую ветку с на указанный хеш
git checkout -B <branchName> <commitHash>
stx:
-- current branch: master
git checkout fix
git branch -f master 5434
---------------------------
git checkout -B master 5424
// save changes in remote branch
git reset HEAD~50 --soft
git reset HEAD .
git stash push -m "Stash description"
git checkout master
git stack pop
// canceled all files if changed
git checkout `git ls-files -m`
// it is command for save password in store (It called credentials)
git config --local credential.helper store
// git clean all files
git clean -fdx
// git restore deleted files after commit
git log --diff-filter=D --summary
git checkout <hash-commit>~1 <your-lost-file-name>