the "git commit" has warned you "nothing to commit (create/copy files and
use "git add" to track)" and if you try git log, you will get someting like:
fatal: bad default revision 'HEAD'

git cannot commit an empty tree, so you should add at least one file for
git to track, try the following commands:

touch README
echo 'Hello world' > README
git add README
git commit -m "first commit"

then try to push again.

2012/8/29 ashu <ashutove...@gmail.com>

> What can be the reason of this error ?
>
> ashu@ashu-G41MT-S2P:~/Documents/git-dir/git1$ sudo git init
> [sudo] password for ashu:
> Initialized empty Git repository in /home/ashu/Documents/git-dir/git1/.git/
> ashu@ashu-G41MT-S2P:~/Documents/git-dir/git1$ git commit -m "first commit"
> fatal: Unable to create
> '/home/ashu/Documents/git-dir/git1/.git/index.lock': Permission denied
> ashu@ashu-G41MT-S2P:~/Documents/git-dir/git1$ sudo git commit -m "first
> commit"
> # On branch master
> #
> # Initial commit
> #
> nothing to commit (create/copy files and use "git add" to track)
> ashu@ashu-G41MT-S2P:~/Documents/git-dir/git1$ sudo git remote add origin
> https://github.com/ashutoshverma/drunken-ironman.git
> *ashu@ashu-G41MT-S2P:~/Documents/git-dir/git1$ sudo git push -u origin
> master
> error: The requested URL returned error: 403 while accessing
> https://github.com/ashutoshverma/drunken-ironman.git/info/refs
>
> fatal: HTTP request failed
> *
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/git-users/-/rE74k7ry258J.
> To post to this group, send email to git-users@googlegroups.com.
> To unsubscribe from this group, send email to
> git-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/git-users?hl=en.
>



-- 
Michael Wang
Unix/Linux Admin | Software Configuration Management
MSN: ylzc...@gmail.com
Blog: http://loveky2012.blogspot.com
命由己作,福由心生;积善之家,必有余庆;

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to