Module 3 - Pull request exercise - What im doing wrong?

Iv been trying Module 3 - Pull request exercise… but it doesnt work as i expect.

I create a local questionbranch and a remote branch called questionsRemote

In terminal i write: git push questionsRemote questionbranch ( git push remote local)
But questionsRemote in github dont get updated. Instead appear a questionbranch also in Github. I dont expect this behaviour. Perhaps is the correct one. Id expect that the hole local questionbranch would be uploaded to questionsRemote and it doesnt.

Thanks in advance…

Exercise: Distributing assignments
Create an organization with your course materials for one assignment in a repository.
Create a Classroom, and an individual assignment.
Send it to a colleague to accept.
Take a snapshot of your teacher dashboard and post it below.

eduardo@MiPcLinux:~ cd GithubTest/ eduardo@MiPcLinux:~/GithubTest mkdir Module3
eduardo@MiPcLinux:~/GithubTest$ cd Module3/
eduardo@MiPcLinux:~/GithubTest/Module3$ atom --wait readme.md
eduardo@MiPcLinux:~/GithubTest/Module3$ git init
Inicializado repositorio Git vacío en /home/eduardo/GithubTest/Module3/.git/
eduardo@MiPcLinux:~/GithubTest/Module3$ git add readme.md
eduardo@MiPcLinux:~/GithubTest/Module3$ git commit -m “First Commit on Module 3”
[master (commit-raíz) 066f95a] First Commit on Module 3
1 file changed, 5 insertions(+)
create mode 100644 readme.md
eduardo@MiPcLinux:~/GithubTest/Module3$ git remote add origin https://github.com/ejgutierrez74/Module3.git
eduardo@MiPcLinux:~/GithubTest/Module3$ git remote -v
origin https://github.com/ejgutierrez74/Module3.git (fetch)
origin https://github.com/ejgutierrez74/Module3.git (push)
eduardo@MiPcLinux:~/GithubTest/Module3$ git branch questionbranch
eduardo@MiPcLinux:~/GithubTest/Module3$ git checkout questionbranch
Cambiado a rama ‘questionbranch’
eduardo@MiPcLinux:~/GithubTest/Module3$ atom --wait questions.md
eduardo@MiPcLinux:~/GithubTest/Module3$ git push origin master
Username for ‘https://github.com’: ejgutierrez74
Password for ‘https://ejgutierrez74@github.com’:
Contando objetos: 3, listo.
Delta compression using up to 4 threads.
Comprimiendo objetos: 100% (2/2), listo.
Escribiendo objetos: 100% (3/3), 277 bytes | 277.00 KiB/s, listo.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/ejgutierrez74/Module3.git

  • [new branch] master -> master
    eduardo@MiPcLinux:~/GithubTest/Module3$ git push questionsRemote questionbranch
    fatal: ‘questionsRemote’ does not appear to be a git repository
    fatal: No se pudo leer del repositorio remoto.

Por favor asegúrese que tiene los permisos de acceso correctos
y que el repositorio existe.
eduardo@MiPcLinux:~/GithubTest/Module3$ git remote add questionsRemote https://github.com/ejgutierrez74/Module3.git
eduardo@MiPcLinux:~/GithubTest/Module3$ git remote -v
origin https://github.com/ejgutierrez74/Module3.git (fetch)
origin https://github.com/ejgutierrez74/Module3.git (push)
questionsRemote https://github.com/ejgutierrez74/Module3.git (fetch)
questionsRemote https://github.com/ejgutierrez74/Module3.git (push)
eduardo@MiPcLinux:~/GithubTest/Module3$ git push questionsRemote questionbranch
Username for ‘https://github.com’: ejgutierrez74
Password for ‘https://ejgutierrez74@github.com’:
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/ejgutierrez74/Module3.git

  • [new branch] questionbranch -> questionbranch
    eduardo@MiPcLinux:~/GithubTest/Module3$ git status
    En la rama questionbranch
    Archivos sin seguimiento:
    (usa “git add …” para incluirlo a lo que se será confirmado)

    questions.md

no hay nada agregado al commit pero hay archivos sin seguimiento presentes (usa “git add” para hacerles seguimiento)
eduardo@MiPcLinux:~/GithubTest/Module3$ git add questions.md
eduardo@MiPcLinux:~/GithubTest/Module3$ git commit -m “Adding questions to questionbranch”
[questionbranch a884f09] Adding questions to questionbranch
1 file changed, 3 insertions(+)
create mode 100644 questions.md
eduardo@MiPcLinux:~/GithubTest/Module3$ git push questionsRemote questionbranch
Username for ‘https://github.com’: ejgutierrez74
Password for ‘https://ejgutierrez74@github.com’:
Contando objetos: 3, listo.
Delta compression using up to 4 threads.
Comprimiendo objetos: 100% (2/2), listo.
Escribiendo objetos: 100% (3/3), 335 bytes | 335.00 KiB/s, listo.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/ejgutierrez74/Module3.git
066f95a…a884f09 questionbranch -> questionbranch
eduardo@MiPcLinux:~/GithubTest/Module3$ git remote
origin
questionsRemote
eduardo@MiPcLinux:~/GithubTest/Module3$ git push questionsRemote questionbranch
Username for ‘https://github.com’: ejgutierrez74
Password for ‘https://ejgutierrez74@github.com’:
Everything up-to-date
eduardo@MiPcLinux:~/GithubTest/Module3$ git status
En la rama questionbranch
nada para hacer commit, el árbol de trabajo esta limpio
eduardo@MiPcLinux:~/GithubTest/Module3$ git log
commit a884f09b1d1fff81aabfbd2dcdbf14266887c863 (HEAD -> questionbranch, questionsRemote/questionbranch)
Author: ejgutierrez74 edufissure@msn.com
Date: Sun Aug 26 20:50:09 2018 +0200

Adding questions to questionbranch

commit 066f95a5cca38645de318dd111c6270235cc7968 (origin/master, master)
Author: ejgutierrez74 edufissure@msn.com
Date: Sun Aug 26 20:36:21 2018 +0200

First Commit on Module 3

eduardo@MiPcLinux:~/GithubTest/Module3$ ^C
eduardo@MiPcLinux:~/GithubTest/Module3$

Thanks in advance…

Hi Eduardo! I’m happy to help with this.

What’s happening when you use
git push <remote> <branch>
is that you are specifying the remote repository, not the branch, that you are pushing too. For instance, if you had a copy of this repository stored on a home pc called home and a copy stored on GitHub called origin, you could push your branch to your home pc by using
git push home questionbranch.

Basically, what has happened is you have given your GitHub repository the alias “questionsRemote”, and then pushing the questionbranch to that remote repository.

If you wanted to push to a branch of a different name you could use
git push <remote> <localbranch>:<remotebranch>
as described here.

Hope this helps!
Chris

Thanks a lot for your explanation. It helped a lot.

I created a remote branch called questionRemote and then by using

git push questionRemote questionbranch

I thought that id “copy” the local questionbranch into the remote branch questionRemote…

Your explanation was clear enough

Id make the exercise again…

© 2017 GitHub, Inc.
with by
GitHub Education