Boa noite! Quando eu tento retornar para a master, ocorre o seguinte erro:
error: Your local changes to the following files would be overwritten by checkout:
arquivo1.txt
podem me ajudar? Obrigada!!
Edit1: tentei fazre um commit, mas acho que piorou as coisas Segue mais um erro:
$ git merge titulo
Auto-merging arquivo1.txt
CONFLICT (content): Merge conflict in arquivo1.txt
Automatic merge failed; fix conflicts and then commit the result.
os comandos que eu dei foram:
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ git checkout master
error: Your local changes to the following files would be overwritten by checkout:
arquivo1.txt
Please commit your changes or stash them before you switch branches.
Aborting
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ git branch
master
* titulo
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ git checkout master
error: Your local changes to the following files would be overwritten by checkout:
arquivo1.txt
Please commit your changes or stash them before you switch branches.
Aborting
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ ^C
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ git checkout -b titulo
fatal: A branch named 'titulo' already exists.
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ commit -m "Editando título"
bash: commit: command not found
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ commit -m "Editando título"
bash: commit: command not found
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ git commit -m "Editando título"
On branch titulo
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: arquivo1.txt
no changes added to commit (use "git add" and/or "git commit -a")
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ git commit -m "Adicionando lista no título"
On branch titulo
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: arquivo1.txt
no changes added to commit (use "git add" and/or "git commit -a")
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ git checkout master
error: Your local changes to the following files would be overwritten by checkout:
arquivo1.txt
Please commit your changes or stash them before you switch branches.
Aborting
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ git add .
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ git commit -m "arrumando bug"
[titulo a2452fd] arrumando bug
1 file changed, 2 insertions(+), 1 deletion(-)
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ git status
On branch titulo
nothing to commit, working tree clean
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (titulo)
$ git checkout master
Switched to branch 'master'
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (master)
$ git commit -m "Corrigindo bug2"
On branch master
nothing to commit, working tree clean
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (master)
$ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: arquivo1.txt
no changes added to commit (use "git add" and/or "git commit -a")
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (master)
$ git add .
alees@Alexandra MINGW64 ~/OneDrive/Documentos/git-e-github/alexandra (master)
$ git commit -m "Corrigindo bug again"
[master 534320a] Corrigindo bug again
1 file changed, 3 insertions(+), 1 deletion(-)
meus arquivos que eu estou usando para a aula são em txt... vou deixar aqui tb como ficou dentro do arquivo:
arquivo editado pela ana
<<<<<<< HEAD
teste bug
=======
-alterando o titulo-
-corrigindo bug-
>>>>>>> titulo