I did init --bare, so that won't be a problem.

These two commands may be helpful for figuring out the issue?

On git repository server machine:

$ git log master 
fatal: ambiguous argument 'master': unknown revision or path not in the 
working tree. 
Use '--' to separate paths from revisions, like this: 
'git <command> [<revision>...] -- [<file>...]'

On git client machine:
abigail@abilina:~/np/my-project$ git remote -v  
origin  git@10.0.0.250:my-project.git (fetch) 
origin  git@10.0.0.250:my-project.git (push)

Does this indicate any issue?

On Monday, October 30, 2017 at 1:20:26 AM UTC-7, Tim Rice wrote:
>
> Hi, 
>
> I can't reproduce the problem precisely, but I'm guessing you did not set 
> up "origin" to be a *bare* repo. 
>
> You can't push to regular repos. Distributing changes between regular 
> repos 
> requires a strict fork-and-pull workflow, although cloning is also 
> permitted. 
>
> To set up a repo that you want to push to (analogous to a repo on GitHub) 
> you need something like the following procedure: 
>
>   $ mkdir ~/my-project.git/   # Alongside the regular repo ~/my-project/ 
>   $ cd ~/my-project.git/ 
>   $ git init --bare 
>   $ cd ~/my-project/ 
>   $ git remote add origin ~/my-project.git/ 
>   $ git push origin master 
>
> If the bare repo is on some other machine that you can ssh to instead of 
> locally, the changes to make are reasonably obvious: 
>
>   my-git-server $ mkdir ~/my-project.git/ 
>   my-git-server $ cd ~/my-project.git/ 
>   my-git-server $ git init --bare 
>
>   my-local-box $ cd ~/my-project/ 
>   my-local-box $ git remote add origin my-git-server:my-project.git 
>   my-local-box $ git push origin master 
>
> Creating and manipulating bare repos is basically how GitHub works under 
> the hood. Everything else is just convenient bling-bling :) 
>
>
> Kind regards, 
>
>
> Tim 
>
>
>
> On Mon, Oct 30, 2017 at 12:07:23AM -0700, Martin wrote: 
> > Hi, All: 
> > 
> > 
> > I created a repository on a home server. I can ssh to the server without 
> > any issue. I can also 'git clone' the empty repository from another home 
> > computer and everything works fine. 
> > 
> > I then tried a simple "git add, git commit". No issue! However, when I 
> do 
> > 'git push origin master', it got stuck there forever without issuing any 
> > warning or error message, as below: 
> > 
> > abigail@abilina:~/my-project$ git push origin master 
> > g...@10.0.0.250 <javascript:>'s password: 
> >                                                                         
>                               
> > Counting objects: 3, done. 
> > Writing objects: 100% (3/3), 208 bytes | 0 bytes/s, done. 
> > Total 3 (delta 0), reused 0 (delta 0) 
> > 
> > The push wasn't successful and got stuck like this. What could be the 
> > reason? 
> > 
> > Thanks. 
> > 
> > -- 
> > 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+...@googlegroups.com <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
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