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
On 7/25/2018 2:34 PM, Konstantin Khomoutov wrote:
On Tue, Jul 24, 2018 at 07:00:05PM -0700, Christopher wrote:
Hi I've cloned a repository but I'm not seeing the cloned files in my local
repository ?
Hi!
I can think of two possibilities.
An unlikely one is that for some reason you've cloned the repository
using the "--bare" and/or "--mirror" command-line option. In this case
the resulting repository ended up being "bare"; bare repositories do not
have an area containing the checked out files — instead, they contain
the Git object database right at their top level directory.
Since the object database does not keep the files committed to the
repository "as is", this could explain why you see no files in the
clone.
A supposedly more likely case is a bit harder to explain.
When you call the `git clone` command without supplying it the
"--branch" command-line option, the local Git asks the remote repository
about the branch it considers to be "current". Having figured that out,
that branch is also made current (and checked out) in the local
repository.
In most repositories used for centralized access (such as those repos
served by Github, Bitbucket etc) the current branch is "master" but 1)
it's possible to change that, and 2) when you clone a regular non-bare
repository the current branch is the one which is currently checked out
there.
So, if for some reason the current branch of the repository you've
cloned contained no files in its tip commit, that state was faithfully
reproduced in the local repository created by the `git clone` command.
To check whether this is indeed the case, you can run
git branch -r -v
in the resulting repository.
Look for the branch named "origin/HEAD" in the left column as this is
what defines "the current branch" in the source repository.
The material in [1] should have you covered on how Git manages branches
it grabs from a remote repository when cloning it and/or fetching from
it.
1. https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches
--
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.