git提交在github上没有显示

3

我是git的新手,有一个非常简单的github仓库,我想提交更改,所以我这样做...

1)启动“Git Bash”(我在Windows系统上) 2)执行...

$ git clone https://github.com/redcricket/simple_flashlight.git

3) 将我的更改从Eclipse导出到simple_flashlight/flashlight/ 4) 进入那个文件夹...

$ cd simple_flashlight/flashlight/

5) 执行差异比较...

$ git diff AndroidManifest.xml
diff --git a/flashlight/AndroidManifest.xml b/flashlight/AndroidManifest.xml
index a57b2c1..59d5fc5 100644
--- a/flashlight/AndroidManifest.xml
+++ b/flashlight/AndroidManifest.xml
@@ -4,6 +4,7 @@
       android:versionCode="1"
       android:versionName="1.0">
     <uses-sdk android:minSdkVersion="8" />
+
<!-- Allows access to the flashlight -->
<uses-permission android:name="android.permission.CAMERA"></uses-permission>
<uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>
@@ -16,7 +17,12 @@


     <application android:icon="@drawable/icon" android:label="@string/app_name"
+    <!--
+      - to prevent "flashing" when orientation changes I added the line
+      - android:configChanges="orientation"
+      -->
         <activity android:name=".FlashlightActivity"
+                         android:configChanges="orientation"
                   android:label="@string/app_name">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
warning: LF will be replaced by CRLF in flashlight/AndroidManifest.xml.
The file will have its original line endings in your working directory.

6) 我通过"staging"来进行...我认为...通过这样做...

(备注:由于上下文缺失,翻译仅供参考)
$ git add AndroidManifest.xml
warning: LF will be replaced by CRLF in flashlight/AndroidManifest.xml.
The file will have its original line endings in your working directory.
$ git status
warning: LF will be replaced by CRLF in flashlight/AndroidManifest.xml.
The file will have its original line endings in your working directory.
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   AndroidManifest.xml
#

7) 这样提交我的代码...

$ git commit -m "do not flash light on orientation change"
[master warning: LF will be replaced by CRLF in flashlight/AndroidManifest.xml.
The file will have its original line endings in your working directory.
361f69b] do not flash light on orientation change
warning: LF will be replaced by CRLF in flashlight/AndroidManifest.xml.
The file will have its original line endings in your working directory.
1 file changed, 6 insertions(+)

然后我查看了我的仓库,链接为https://github.com/redcricket/simple_flashlight/commits/master,但是我没有看到我的更改。这是我的git配置...

$ git config --global -l
user.name=redcricket
user.email=red.cricket.blog@gmail.com

我做错了什么?

谢谢!

1个回答

5

您将更改提交到存储库的本地副本。

如果您想在GitHub上查看该提交,则需要首先git push它。


太棒了!谢谢……现在如果我能记住我的密码就好了 :) - Red Cricket

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接