如何使用 Git Bash 和 GitHub 添加文件夹?

How to add folders using Git Bash and GitHub?

在我现有的本地存储库中,我从 GitHub 存储库中执行了 git clone,然后我下载了一个新文件夹。然后我做了 git add *,因为 I read here 这不仅会添加文件,还会添加文件夹。之后,我进行了提交和推送的正常流程。但是,我只能看到推送到 Bitbucket 上的文件,没有文件夹……即使我下载的文件夹位于我的本地存储库中。当我执行 git status 时,我收到此消息:

On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean

感谢您的帮助。


根据以下评论中的要求分享 git log 的输出:

commit 1922f3e0d535f1f840e7bd8bcd5a7a150d55186e
Author: George.Liu <>
Date:   Mon Oct 17 16:25:45 2016 -0400

    HIVE-356: Add updated reference and sample code

diff --git a/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb b/Investigate BidMana                                                                                                                                                 ger API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb
index b4ea52b..2a0860a 100644
--- a/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb
+++ b/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb
@@ -26,7 +26,11 @@
     "\n",
     "[Create and Access Scheduled Reports](https://developers.google.com/bid-manager/guides/scheduled-reports/overview)\n",
     "\n",
-    "[Google Cloud APIs & Reference](https://cloud.google.com/storage/docs/apis)"
+    "[Google Cloud APIs & Reference](https://cloud.google.com/storage/docs/apis)\n",
+    "\n",
+    "[Google API Client Libraries](https://developers.google.com/api-client-library/python/guide/aaa_oauth)\n",
+    "\n",
+    "[DoubleClick Bid Manager REST API Python Samples](https://github.com/googleads/googleads-bidmanager-examples/tree/master                                                                                                                                                 /python)"
    ]
   },
   {
@@ -35,15 +39,6 @@
    "source": [
     "095673046801875030801475612094991_report/Daily_DBM_Clearing_Price_2016-10-04-2014.csv"
:...skipping...
commit 1922f3e0d535f1f840e7bd8bcd5a7a150d55186e
Author: George.Liu <>
Date:   Mon Oct 17 16:25:45 2016 -0400

    HIVE-356: Add updated reference and sample code

diff --git a/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb b/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb
index b4ea52b..2a0860a 100644
--- a/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb
+++ b/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb
@@ -26,7 +26,11 @@
     "\n",
     "[Create and Access Scheduled Reports](https://developers.google.com/bid-manager/guides/scheduled-reports/overview)\n",
     "\n",
-    "[Google Cloud APIs & Reference](https://cloud.google.com/storage/docs/apis)"
+    "[Google Cloud APIs & Reference](https://cloud.google.com/storage/docs/apis)\n",
+    "\n",
+    "[Google API Client Libraries](https://developers.google.com/api-client-library/python/guide/aaa_oauth)\n",
+    "\n",
+    "[DoubleClick Bid Manager REST API Python Samples](https://github.com/googleads/googleads-bidmanager-examples/tree/master/python)"
    ]
   },
   {
@@ -35,15 +39,6 @@
    "source": [
     "095673046801875030801475612094991_report/Daily_DBM_Clearing_Price_2016-10-04-2014.csv"
    ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
   }
  ],
  "metadata": {
diff --git a/Investigate BidManager API_HIVE-356/BidMgr API_Hive-356.ipynb b/Investigate BidManager API_HIVE-356/BidMgr API_Hive-356.ipynb
index b4ea52b..2a0860a 100644
--- a/Investigate BidManager API_HIVE-356/BidMgr API_Hive-356.ipynb
+++ b/Investigate BidManager API_HIVE-356/BidMgr API_Hive-356.ipynb
@@ -26,7 +26,11 @@
     "\n",
     "[Create and Access Scheduled Reports](https://developers.google.com/bid-manager/guides/scheduled-reports/overview)\n",
     "\n",
-    "[Google Cloud APIs & Reference](https://cloud.google.com/storage/docs/apis)"
+    "[Google Cloud APIs & Reference](https://cloud.google.com/storage/docs/apis)\n",
+    "\n",
+    "[Google API Client Libraries](https://developers.google.com/api-client-library/python/guide/aaa_oauth)\n",
+    "\n",
+    "[DoubleClick Bid Manager REST API Python Samples](https://github.com/googleads/googleads-bidmanager-examples/tree/master/python)"
    ]
   },
   {
@@ -35,15 +39,6 @@
    "source": [
     "095673046801875030801475612094991_report/Daily_DBM_Clearing_Price_2016-10-04-2014.csv"
    ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
   }
  ],
  "metadata": {
diff --git a/Investigate BidManager API_HIVE-356/googleads-bidmanager-examples b/Investigate BidManager API_HIVE-356/googleads-bidmanager-examples
new file mode 160000
index 0000000..14f4511
--- /dev/null
+++ b/Investigate BidManager API_HIVE-356/googleads-bidmanager-examples
@@ -0,0 +1 @@
+Subproject commit 14f451107adb0825839d03bc1d809b55046a1da4

commit 6b3cdba5e69468d87bc59e591b4899cc37381222
Author: George.Liu <>
Date:   Thu Oct 6 14:43:20 2016 -0400

    Add repo for bm api project

diff --git a/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb b/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb
index 2de2cf1..b4ea52b 100644
--- a/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb
+++ b/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb
@@ -15,6 +15,28 @@
    ]
   },
   {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Reference\n",
+    "\n",
+    "[Get Started with the API](https://developers.google.com/bid-manager/guides/getting-started-api)\n",
+    "\n",
+    "[API Reference](https://developers.google.com/bid-manager/v1/)\n",
+    "\n",
+    "[Create and Access Scheduled Reports](https://developers.google.com/bid-manager/guides/scheduled-reports/overview)\n",
+    "\n",
+    "[Google Cloud APIs & Reference](https://cloud.google.com/storage/docs/apis)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "095673046801875030801475612094991_report/Daily_DBM_Clearing_Price_2016-10-04-2014.csv"
+   ]
+  },
+  {
    "cell_type": "code",
    "execution_count": null,
    "metadata": {
diff --git a/Investigate BidManager API_HIVE-356/BidMgr API_Hive-356.ipynb b/Investigate BidManager API_HIVE-356/BidMgr API_Hive-356.ipynb
index 2de2cf1..b4ea52b 100644
--- a/Investigate BidManager API_HIVE-356/BidMgr API_Hive-356.ipynb
+++ b/Investigate BidManager API_HIVE-356/BidMgr API_Hive-356.ipynb
@@ -15,6 +15,28 @@
    ]
   },
   {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Reference\n",
+    "\n",
+    "[Get Started with the API](https://developers.google.com/bid-manager/guides/getting-started-api)\n",
+    "\n",
+    "[API Reference](https://developers.google.com/bid-manager/v1/)\n",
+    "\n",
+    "[Create and Access Scheduled Reports](https://developers.google.com/bid-manager/guides/scheduled-reports/overview)\n",
+    "\n",
+    "[Google Cloud APIs & Reference](https://cloud.google.com/storage/docs/apis)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "095673046801875030801475612094991_report/Daily_DBM_Clearing_Price_2016-10-04-2014.csv"
+   ]
+  },
+  {
    "cell_type": "code",
    "execution_count": null,
    "metadata": {

commit 804d2fbe74fb670b3d9e8ab208a3fdb453c4a0c0
Author: George.Liu <>
Date:   Thu Oct 6 13:45:16 2016 -0400

    HIVE-356: Add new repo for bm api task

diff --git a/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb b/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb
new file mode 100644
index 0000000..2de2cf1
--- /dev/null
+++ b/Investigate BidManager API_HIVE-356/.ipynb_checkpoints/BidMgr API_Hive-356-checkpoint.ipynb
@@ -0,0 +1,48 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# Investigate BidManager API for Daily Data Acquisition"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "The goal of this project is to research BidManager API and find out the process to use it for data acquisition. We'll also do a test with the api to get reports from BidManager."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "collapsed": true
+   },
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python [Root]",
+   "language": "python",
+   "name": "Python [Root]"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 2
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython2",
+   "version": "2.7.12"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Investigate BidManager API_HIVE-356/BidMgr API_Hive-356.ipynb b/Investigate BidManager API_HIVE-356/BidMgr API_Hive-356.ipynb
new file mode 100644
index 0000000..2de2cf1
--- /dev/null
+++ b/Investigate BidManager API_HIVE-356/BidMgr API_Hive-356.ipynb
@@ -0,0 +1,48 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# Investigate BidManager API for Daily Data Acquisition"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "The goal of this project is to research BidManager API and find out the process to use it for data acquisition. We'll also do a test with the api to get reports from BidManager."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "collapsed": true
+   },
+   "outputs": [],
+   "source": []
+  }
:

正如聊天中所讨论的,您的要求是从另一个存储库添加文件夹。假设你想在 repoB 中添加 repoA,那么你只需要使用 git submodule

可能的帮助:https://git-scm.com/book/en/v2/Git-Tools-Submodules http://schacon.github.io/git/user-manual.html#submodules

Git不关心folders/directories。您在日志中看不到它们,因为它们不存在。这就是为什么人们在需要空目录时在其他空目录中提交 .gitkeep 文件的原因。