Возможно, я ошибаюсь, но я следую инструкциям git как есть.У меня есть репозиторий в bitbucket под названием «testrepos», и я пытаюсь с ним работать.
Сначала я клонирую его с git clone https://my_username@bitbucket.org/my_username/testrepos.git
Теперь репозиторий пуст, поэтому я сделалфайл с именем main.cpp.Затем я запускаю «git add main.cpp».Если я сейчас запускаю git status
, я вижу, что есть новый файл с именем main.cpp для фиксации.
Наконец, я запускаю git commit -m 'First commit'
.Есть 0 изменений, 0 вставок и 0 удалений!Почему мои файлы не фиксируются?Я также использую push
и pull
.
edit Вот полный журнал:
Welcome to Git (version 1.7.7-preview20111014)
Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.
chris@EDI ~
$ cd git
chris@EDI ~/git
$ git clone https://my_username@bitbucket.org/my_username/testrepos.git
Cloning into testrepos...
Password:
warning: You appear to have cloned an empty repository.
chris@EDI ~/git
$ cd testrepos/
chris@EDI ~/git/testrepos (master)
$ git pull
Password:
Your configuration specifies to merge with the ref 'master'
from the remote, but no such ref was fetched.
chris@EDI ~/git/testrepos (master)
$ git add temp.cpp
chris@EDI ~/git/testrepos (master)
$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: temp.cpp
#
chris@EDI ~/git/testrepos (master)
$ git commit -m 'Committing temp file'
[master (root-commit) 5d659df] Committing temp file
Committer: unknown <chris@EDI.(none)>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 temp.cpp
chris@EDI ~/git/testrepos (master)
$ git pull
Password:
Your configuration specifies to merge with the ref 'master'
from the remote, but no such ref was fetched.
chris@EDI ~/git/testrepos (master)
$ git push
Password:
Everything up-to-date