On Sun, Jul 29, 2018 at 10:31:02AM -0400, CrestChristopher wrote:

Hi!

First things first: do I understand correctly that your original problem
("cloned local repository is empty") is solved?

> Hi, I have a commit file although I'm attempting to push it to a repository,
> not github; a private repository. When doing `git remote -v` for both `push`
> and `fetch` the remote repository is listed but when I try to push to the
> private repository by means of `git push` I get this error ?
> 
> 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

Uh, but Git actually told you what is wrong and offered you one way to
solve the problem; why did you ignore that?

The exact explanation of how `git push` without any extra arguments
works is kinda compilcated, and I do not see fit in diving into that
right now. In this particular case I'd do what Git suggested you to do -
run

  git push -u origin master

This will:

 1. Take your local branch named "master", push it to the remote
    repository locally known as "origin" and use the pushed commits
    to update a branch named "master" _there_.

 2. Record - in the local repository's configuration data - that the
    local branch "master" is "linked to" a branch named "master" in
    the remote repository known as "origin".

The latter would allow unadorned calls to `git push` to figure out that
you indeed meant to update "master" at "origin" with the changes done
on "master" locally.

Jumping through these hoops is needed because Git offers sheer
flexibility in dealing with multiple remote repositories and multiple
branches in it. (And this is actually exploited by Git "power users";
for instance a so-called "triangular workflow" - where you fetch changes
from one repository but push your own work into another - is reasonably
common.)

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to