# Trying to push from my local dir to the Github repo

2 messages from 2020-07-21 to 2020-07-21. Participants: bruce, Bryan Turner.
Thread: https://gitlist.dev/t/53893

## bruce, 2020-07-21 18:27

Subject: Trying to push from my local dir to the Github repo
Message-ID: <CAP16ngo5FRjhz2DwwcMunm4KfjQQDUe-hiigRk_oc1ugwe2xew@mail.gmail.com>
URL: https://gitlist.dev/e/CAP16ngo5FRjhz2DwwcMunm4KfjQQDUe-hiigRk_oc1ugwe2xew%40mail.gmail.com

```
Hi.

As a test, I cloned a repo to my local machine.

I then made a few changes to files.

I'm now trying to push the files/repo to the new Github repo

It appears I'm missing something. No matter what I'm doing, the new
repo in Github, is populated with the files from the initial/cloned
repo.

The steps I've used

mkdir foo
cd foo
git clone http:/github.com/foo/cat.git

git remote rename origin upstream
git remote add origin https://github.com/numinds/testapp.git
git remote -v
master    https://github.com/numinds/testapp.git (fetch)
master    https://github.com/numinds/testapp.git (push)
origin    https://github.com/numinds/testapp.git (fetch)
origin    https://github.com/numinds/testapp.git (push)
remote    https://github.com/numinds/testapp.git (fetch)
remote    https://github.com/numinds/testapp.git (push)
upstream    https://github.com/numinds/testapp.git (fetch)
upstream    https://github.com/numinds/testapp.git (push)

git push origin master
Username for 'https://github.com': numinds
Password for 'https://numinds@github.com':
Enumerating objects: 3050, done.
Counting objects: 100% (3050/3050), done.
Compressing objects: 100% (2816/2816), done.
Writing objects: 100% (3050/3050), 6.01 MiB | 15.23 MiB/s, done.
Total 3050 (delta 120), reused 3050 (delta 120)
remote: Resolving deltas: 100% (120/120), done.

To https://github.com/numinds/testapp.git

 * [new branch]      master -> master

Obviously, I'm missing something in the process.

Any pointers/Comments would be welcome.

thanks

```

## Bryan Turner, 2020-07-21 20:10

Subject: Re: Trying to push from my local dir to the Github repo
Message-ID: <CAGyf7-GodFVdPRhPxpRqwyW2jjFUTaOT9XuXz6fsiQ--BfBPFQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAGyf7-GodFVdPRhPxpRqwyW2jjFUTaOT9XuXz6fsiQ--BfBPFQ%40mail.gmail.com
In-Reply-To: <CAP16ngo5FRjhz2DwwcMunm4KfjQQDUe-hiigRk_oc1ugwe2xew@mail.gmail.com>

```
On Tue, Jul 21, 2020 at 11:28 AM bruce <badouglas@gmail.com> wrote:
>
> Hi.
>
> As a test, I cloned a repo to my local machine.
>
> I then made a few changes to files.
>
> I'm now trying to push the files/repo to the new Github repo
>
> It appears I'm missing something. No matter what I'm doing, the new
> repo in Github, is populated with the files from the initial/cloned
> repo.
>
> The steps I've used
>
> mkdir foo
> cd foo
> git clone http:/github.com/foo/cat.git
>
> git remote rename origin upstream
> git remote add origin https://github.com/numinds/testapp.git
> git remote -v
> master    https://github.com/numinds/testapp.git (fetch)
> master    https://github.com/numinds/testapp.git (push)
> origin    https://github.com/numinds/testapp.git (fetch)
> origin    https://github.com/numinds/testapp.git (push)
> remote    https://github.com/numinds/testapp.git (fetch)
> remote    https://github.com/numinds/testapp.git (push)
> upstream    https://github.com/numinds/testapp.git (fetch)
> upstream    https://github.com/numinds/testapp.git (push)

You don't really need the same remote URL 4 times; it looks like you
could just remove "master", "remote" and "upstream" as they're all the
same as "origin". (It's unlikely this is causing any problem; it just
means you have 4 remote-tracking refs for each branch in
numinds/testapp.

>
> git push origin master
> Username for 'https://github.com': numinds
> Password for 'https://numinds@github.com':
> Enumerating objects: 3050, done.
> Counting objects: 100% (3050/3050), done.
> Compressing objects: 100% (2816/2816), done.
> Writing objects: 100% (3050/3050), 6.01 MiB | 15.23 MiB/s, done.
> Total 3050 (delta 120), reused 3050 (delta 120)
> remote: Resolving deltas: 100% (120/120), done.
>
> To https://github.com/numinds/testapp.git
>
>  * [new branch]      master -> master
>
> Obviously, I'm missing something in the process.

So you're explicitly pushing "master". Is that the branch you have
checked out? What does "git branch" or "git status" show? If you have
some other branch checked out but you push "master", then your changes
won't be visible.

Your example steps don't actually show anything related to making
changes. They show your remotes (excessive, but functional) and they
show a successful push. They don't show you modifying any files or
committing any files.

Perhaps you can provide some more details? Everything you've shown so
far looks fine.

Best regards,
Bryan Turner

```
