0
Hello again to all I’m going through a very boring problem... and so far I haven’t been able to identify.. Whenever I try to push or pull in my project I get the messages below, and nothing goes up there on github, please if anyone knows how to solve please help me I’m new in this git business and I’m pretty lost..., thanks from now on for your attention:
Obs: the code below is a test plus this occurs with other project folders as well..
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git add .
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git commit -m "subir novo projeto"
On branch master
nothing to commit, working tree clean
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git push branch master
fatal: 'branch' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git push origin master
To https://github.com/Gustavocgsg/RepositorioTeste.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/Gustavocgsg/RepositorioTeste.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git pull origin master
From https://github.com/Gustavocgsg/RepositorioTeste
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
fatal: refusing to merge unrelated histories
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git status
On branch master
nothing to commit, working tree clean
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git fetch
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git status
On branch master
nothing to commit, working tree clean
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git merge
fatal: No remote for the current branch.
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git remote https://github.com/Gustavocgsg/RepositorioTeste.git
error: Unknown subcommand: https://github.com/Gustavocgsg/RepositorioTeste.git
usage: git remote [-v | --verbose]
or: git remote add [-t <branch>] [-m <master>] [-f] [--tags | --no-tags] [--mirror=<fetch|push>] <name> <url>
or: git remote rename <old> <new>
or: git remote remove <name>
or: git remote set-head <name> (-a | --auto | -d | --delete | <branch>)
or: git remote [-v | --verbose] show [-n] <name>
or: git remote prune [-n | --dry-run] <name>
or: git remote [-v | --verbose] update [-p | --prune] [(<group> | <remote>)...]
or: git remote set-branches [--add] <name> <branch>...
or: git remote get-url [--push] [--all] <name>
or: git remote set-url [--push] <name> <newurl> [<oldurl>]
or: git remote set-url --add <name> <newurl>
or: git remote set-url --delete <name> <url>
-v, --verbose be verbose; must be placed before a subcommand
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git remote -v
RepositorioTeste https://github.com/Gustavocgsg/RepositorioTeste.git (fetch)
RepositorioTeste https://github.com/Gustavocgsg/RepositorioTeste.git (push)
origin https://github.com/Gustavocgsg/RepositorioTeste.git (fetch)
origin https://github.com/Gustavocgsg/RepositorioTeste.git (push)
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git remote RepositorioTeste
error: Unknown subcommand: RepositorioTeste
usage: git remote [-v | --verbose]
or: git remote add [-t <branch>] [-m <master>] [-f] [--tags | --no-tags] [--mirror=<fetch|push>] <name> <url>
or: git remote rename <old> <new>
or: git remote remove <name>
or: git remote set-head <name> (-a | --auto | -d | --delete | <branch>)
or: git remote [-v | --verbose] show [-n] <name>
or: git remote prune [-n | --dry-run] <name>
or: git remote [-v | --verbose] update [-p | --prune] [(<group> | <remote>)...]
or: git remote set-branches [--add] <name> <branch>...
or: git remote get-url [--push] [--all] <name>
or: git remote set-url [--push] <name> <newurl> [<oldurl>]
or: git remote set-url --add <name> <newurl>
or: git remote set-url --delete <name> <url>
-v, --verbose be verbose; must be placed before a subcommand
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git clone https://github.com/Gustavocgsg/RepositorioTeste.git
Cloning into 'RepositorioTeste'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git status
On branch master
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)
deleted: index.html
Untracked files:
(use "git add <file>..." to include in what will be committed)
RepositorioTeste/
no changes added to commit (use "git add" and/or "git commit -a")
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git add .
warning: adding embedded git repository: RepositorioTeste
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint: git submodule add <url> RepositorioTeste
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint: git rm --cached RepositorioTeste
hint:
hint: See "git help submodule" for more information.
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git add .
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git commit -m "nova tentativa de subir arquivos"
[master 2b87106] nova tentativa de subir arquivos
2 files changed, 1 insertion(+)
create mode 160000 RepositorioTeste
rename index.html => index_v1.html (100%)
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$ git push origin master
To https://github.com/Gustavocgsg/RepositorioTeste.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/Gustavocgsg/RepositorioTeste.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
gusta@GUSTAVO-PC MINGW64 /c/RepositorioTeste (master)
$
Carlos, use the command
git remote -v
and see if you have a repositoryorigin
listed. If not, type with this commandgit remote add origin
– Colasanto
Colasanto Afternoon, I did what you asked and he informs me the following:
RepositorioTeste https://github.com/Gustavocgsg/RepositorioTeste.git (fetch)
RepositorioTeste https://github.com/Gustavocgsg/RepositorioTeste.git (push)
origin https://github.com/Gustavocgsg/RepositorioTeste.git (fetch)
origin https://github.com/Gustavocgsg/RepositorioTeste.git (push)
– Carlos Gustavo Souza Guimarães