# Noob, can't get \`git push\` working

**URL:** <https://forum.gitea.com/t/noob-cant-get-git-push-working/1151>\
**Category:** Install/Maintain/Configure\
**Created:** [May 9, 2019, 7:11am UTC](https://forum.gitea.com/t/noob-cant-get-git-push-working/1151 "2019-05-09T07:11:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![odigity](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/odigity/32/4827_2.png) [@odigity](https://forum.gitea.com/u/odigity)\
**Post date:** [May 9, 2019, 7:11am UTC](https://forum.gitea.com/t/noob-cant-get-git-push-working/1151/1 "2019-05-09T07:11:03Z")

</div>

Decided to try Gitea today by setting it up on my personal hosted server running Ubuntu 18.04.

I downloaded the v1.8.1 binary and gitea.service file, followed the install docs (including creating a ‘git’ user), completed the web-based setup process, and then created an organization and a repo within it. Everything was going great till I tried to `git push -u origin master` and was prompted for a username and password.

I tried the username/password for my Gitea user account, but it didn’t work. I tried ‘git’ as the username with no password, but it didn’t work. I went back to the web UI and added my SSH key to my user account, then again tried both ‘git’ and my username, but neither worked.

What might I be missing?

---

<div class="post-metadata">

**Author:** ![oscarlo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/oscarlo/32/4781_2.png) [@oscarlo](https://forum.gitea.com/u/oscarlo)\
**Post date:** [May 9, 2019, 2:14pm UTC](https://forum.gitea.com/t/noob-cant-get-git-push-working/1151/2 "2019-05-09T14:14:01Z")

</div>

Did you initialize the repository in the UI or is this your initial commit?

---

<div class="post-metadata">

**Author:** ![odigity](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/odigity/32/4827_2.png) [@odigity](https://forum.gitea.com/u/odigity)\
**Post date:** [May 9, 2019, 3:30pm UTC](https://forum.gitea.com/t/noob-cant-get-git-push-working/1151/3 "2019-05-09T15:30:20Z")

</div>

I created an uninitialized repo (foo) via the web UI, then on my desktop:

```
$ mkdir foo
$ cd foo
$ touch .gitignore
$ git init
$ git add .gitignore
$ git commit -m "first commit"
$ git remote add origin https://<mydomain>.com/<myorg>/foo.git
$ git push -u origin master

```

Which is when I am prompted for user/pass.

Oh yeah, forgot to mention: I also tried adding the domain to my ~/.ssh/config to set the default username to ‘git’, which didn’t help:

```
$ cat ~/.ssh/config
...
Host git.<mydomain>.com
    User git
...
```

---

<div class="post-metadata">

**Author:** ![odigity](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/odigity/32/4827_2.png) [@odigity](https://forum.gitea.com/u/odigity)\
**Post date:** [May 10, 2019, 4:56am UTC](https://forum.gitea.com/t/noob-cant-get-git-push-working/1151/4 "2019-05-10T04:56:11Z")

</div>

Update: I just realized I only ever tried the HTTPS method, not the SSH method. So, I created another empty repo, just like the first one, but this time I added `git@git.<mydomain>.com:<myorg>/foo.git` as the origin, and the `git push` worked fine with no auth prompts.

Sorry, I’ve never given much thought to the difference between the HTTPS & SSH methods, and just grabbed the first one I saw. I’ll just stick with the SSH method now.
