Обычно я работал бы с локальной веткой под названием test
, а затем объединял бы эту ветвь с master
после завершения функции. Однако по той или иной причине я потерял свои последние изменения.
Вот что я сделал:
T:\Test [test × +4 ~3 -5 !]> git status
On branch test
Your branch is based on 'origin/test', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: jest.config.js
modified: ormconfig.ts
modified: src/index.ts
deleted: src/it-portal/entity/Kiwi.ts
deleted: src/it-portal/entity/Movie.ts
deleted: src/it-portal/entity/User.ts
deleted: src/resolvers/HelloWorldResolver.ts
deleted: src/resolvers/MovieResolver.test.ts
deleted: src/resolvers/MovieResolver.ts
deleted: src/tests/Interfaces/global.d.ts
deleted: src/tests/config/globalSetup.ts
deleted: src/tests/config/globalTeardown.ts
deleted: src/tests/config/setupFiles.ts
Untracked files:
(use "git add <file>..." to include in what will be committed)
src/it-portal/entity/Account.ts
src/resolvers/AccountResolver.test.ts
src/resolvers/AccountResolver.ts
src/test-utils/
no changes added to commit (use "git add" and/or "git commit -a")
T:\Test [test × +4 ~3 -10 !]> git add .
T:\Test [test × +4 ~7 -6 ~]> git commit -am 'added Account entity and resolvers'
[test caaa67a] added Account entity and resolvers
17 files changed, 164 insertions(+), 183 deletions(-)
create mode 100644 src/it-portal/entity/Account.ts
delete mode 100644 src/it-portal/entity/Kiwi.ts
delete mode 100644 src/it-portal/entity/Movie.ts
delete mode 100644 src/it-portal/entity/User.ts
create mode 100644 src/resolvers/AccountResolver.test.ts
create mode 100644 src/resolvers/AccountResolver.ts
delete mode 100644 src/resolvers/HelloWorldResolver.ts
delete mode 100644 src/resolvers/MovieResolver.test.ts
delete mode 100644 src/resolvers/MovieResolver.ts
rename src/{tests => test-utils}/Interfaces/global.d.ts (100%)
rename src/{tests => test-utils}/config/globalSetup.ts (100%)
rename src/{tests => test-utils}/config/globalTeardown.ts (100%)
rename src/{tests => test-utils}/config/setupFiles.ts (100%)
create mode 100644 src/test-utils/helpers/axios.ts
T:\Test [test ×]> git checkout master
fatal: cannot create directory at 'src/resolvers': Permission denied
T:\Test [test × +3 ~3 -8 !]> git merge test
Already up to date.
T:\Tes [test × +3 ~3 -8 !]> git checkout master
error: Your local changes to the following files would be overwritten by checkout:
jest.config.js
ormconfig.ts
src/index.ts
Please commit your changes or stash them before you switch branches.
error: The following untracked working tree files would be overwritten by checkout:
src/it-portal/entity/Kiwi.ts
src/it-portal/entity/Movie.ts
src/it-portal/entity/User.ts
Please move or remove them before you switch branches.
Aborting
T:\Test [test × +3 ~3 -8 !]> git log
commit caaa67ae6643b5efa2c7f3bd65a3aa4317037367 (HEAD -> test)
Author: Me <bob@gmail.com>
Date: Thu Jun 18 14:25:10 2020 +0200
added Account entity and resolvers
commit 724bb33f38f3c380ac07666f0f6c3e5ca8648d8f (origin/master, master)
Author: Me <bob@gmail.com>
Date: Wed Jun 17 15:27:14 2020 +0200
T:\Test [test × +3 ~3 -8 !]> git status
On branch test
Your branch is based on 'origin/test', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: jest.config.js
modified: ormconfig.ts
modified: src/index.ts
deleted: src/it-portal/entity/Account.ts
deleted: src/resolvers/AccountResolver.test.ts
deleted: src/resolvers/AccountResolver.ts
deleted: src/test-utils/Interfaces/global.d.ts
deleted: src/test-utils/config/globalSetup.ts
deleted: src/test-utils/config/globalTeardown.ts
deleted: src/test-utils/config/setupFiles.ts
deleted: src/test-utils/helpers/axios.ts
Untracked files:
(use "git add <file>..." to include in what will be committed)
src/it-portal/entity/Kiwi.ts
src/it-portal/entity/Movie.ts
src/it-portal/entity/User.ts
no changes added to commit (use "git add" and/or "git commit -a")
T:\Test [test × +3 ~3 -8 !]> git branch
master
* test
Я заметил, что что-то пошло не так при переключении на ветку master
. Но теперь, хотя я сделал правильную фиксацию в тесте и все еще находясь в ветке test
, он не показывает мне добавленные файлы, такие как Account.ts
, и все еще показывает мне удаленные файлы, такие как Kiwi.ts
. Есть идеи, как это исправить?
Также проверьте ниже, это показывает то, чего я не хочу.
T:\Test [test × +3 ~3 -8 !]> git checkout test
Switched to branch 'test'
M jest.config.js
M ormconfig.ts
M src/index.ts
D src/it-portal/entity/Account.ts
D src/resolvers/AccountResolver.test.ts
D src/resolvers/AccountResolver.ts
D src/test-utils/Interfaces/global.d.ts
D src/test-utils/config/globalSetup.ts
D src/test-utils/config/globalTeardown.ts
D src/test-utils/config/setupFiles.ts
D src/test-utils/helpers/axios.ts
Your branch is based on 'origin/test', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)