如何从 git master 拉取新文件?

How to pull new files from git master?

您好,我一直在搜索所有的论坛和搜索引擎来做我认为简单的事情。我正在尝试将我的主 git 存储库中的所有更改拉到远程分支中。它会这样做,但不会拉入创建的新文件。我到底怎样才能确保新文件被添加到

的分支
git pull

我试过了:

git checkout master newfile.html

git checkout HEAD -- newfile.html

我认为默认情况下 'pull' 只会更新 master 中的所有内容,无论是新的还是非新的,但显然不是这样。我该怎么做?

我相信你一定要做

git pull origin branch_name

您好,感谢您的回复。它似乎对所有 3 个都有效:

git checkout master
Already on 'master'
git merge master
git pull


Enter passphrase for key '/home/seytunn/.ssh/id_dsa': 
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 10 (delta 7), reused 7 (delta 4), pack-reused 0
Unpacking objects: 100% (10/10), done.
From github.com:seytunn/my_rnnn
6fc621c..64afc61  master     -> origin/master
Updating 6fc621c..64afc61
Fast-forward
css/main.css |   21 +++++++-
require.html  |  152    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 172 insertions(+), 1 deletions(-)
 create mode 100644 require.html