似乎很容易,但我只是不明白.我是我申请的根本.
这是我的工作流程.
git add .
git commit -m "added a new feature some files changed"
git push heroku master
Run Code Online (Sandbox Code Playgroud)
这通常有效.我所有的改变都被推了.
但有时候我有一个我改变的文件,但是当我推送到Heroku时,这些文件的更改并不存在......但是对于大多数文件而言,更改都在那里......
但如果我这样做
git add .
git commit -am "added a new feature some files changed"
git push heroku master
Run Code Online (Sandbox Code Playgroud)
一切(所有变化)都被推送到Heroku
我想添加所有文件,无论是什么:是删除,创建,修改,未跟踪等?我只是不想与git添加所有我的文件EVERY TIME.我试过git add -A但它不是在文件夹中添加修改过的文件.
这是git status我项目的初始内容:
Rakib-MacBook-Pro:my-xcode-practice rakib$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# (commit or discard the untracked or modified content in submodules)
#
# modified: BankAccount (modified content, untracked content)
# modified: BuckysButtons (modified content, untracked content)
# …Run Code Online (Sandbox Code Playgroud) 我从我的git repo中删除了一些文件,现在,状态见
# Changes not staged for commit:
# ...
# deleted: project/war/favicon.ico
# deleted: project/war/index.html
Run Code Online (Sandbox Code Playgroud)
通常,我会通过发出git add .命令来暂存它们,但这样做不会影响git状态.文件仍未进行提交.
现在..我知道我可以git rm file照顾这个.
问题是...我可以修改git add .某种方式也可以暂存已删除的文件吗?我想加上"." 照顾一切(包括已删除的文件)
我正在使用git跟踪一些配置文件.我通常做一个交互式,git add -p但我正在寻找一种方法来自动添加与模式匹配的所有新/修改/删除的行.否则,我需要花费很多时间来完成所有交互式拆分并添加.git add有一个模式匹配的文件名,但我找不到有关内容的任何内容.
之间有什么区别:
git add .
Run Code Online (Sandbox Code Playgroud)
和
git add --all
Run Code Online (Sandbox Code Playgroud)
?
我试图做出一些改变,但由于我不明白的原因,他们被抛在了后面:
我看一下当前的回购状态:
% git status
On branch new-master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: __init__.py
new file: api/__init__.py
new file: api/api.py
new file: api/common.py
new file: api/error.py
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: ../status/server.py
modified: __init__.py
Untracked files:
(use "git add <file>..." to include in what will be committed)
../env/
../foo.db …Run Code Online (Sandbox Code Playgroud) 我在〜/ bin获得git-status:
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# screen/dev/
Run Code Online (Sandbox Code Playgroud)
我跑
git add --force screen/dev/
Run Code Online (Sandbox Code Playgroud)
我得到了和以前一样的git-status.我独立地在文件夹中添加每个文件,但我得到相同的git-status.
屏幕/ dev /中没有.git.该文件夹似乎不是一个sumbodule.
如何在〜/ bin中强制添加一个文件夹及其内容给我的git?
我过去使用git命令为我的github文件:
add --update :/
Run Code Online (Sandbox Code Playgroud)
正如有人告诉我这是获取已添加,删除和更新的所有文件的最佳方式.
但是阅读之后:"git add -A"和"git add"之间的区别.
我想也许我应该用 git add -A
有人能告诉我是否存在差异以及git add --update :/实际上有什么作用?