将一些其他分支合并到一个分支中后,在分支中获取我修改的文件

时间:2016-01-28 15:06:07

标签: git github merge

假设我有一个名为a的分支。我已对其进行了一些更改。

提交中的更改。

1.txt
2.txt
3.txt

现在我已经在我的分支master中合并了一些名为a的分支。

还有一些其他文件已添加到我的分支a

更改合并为,

10.txt
11.txt
12.txt

现在分支a可以进行所有更改。

我想要自己修改的文件名。

如此尝试,

git checkout a
git diff --name-only master

但是这会给我自己+其他人修改或添加的所有文件。

我只查找由我修改的文件。

解决这个问题的方法是什么?

1 个答案:

答案 0 :(得分:0)

怎么样:

Request Method: POST
Request URL: http://127.0.0.1:8000/actions/create

Django Version: 1.8.7
Python Version: 2.7.0
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'app',
'django.contrib.admin',
'django.contrib.admindocs')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\core\handlers\base.py" in get_response
132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\app\views.py" in actioncreate
53.             act.action_id = form2.save()
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\forms\models.py" in save
459.                              construct=False)
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\forms\models.py" in save_instance
105.         instance.save()
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\db\models\base.py" in save
734.                        force_update=force_update, update_fields=update_fields)
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\db\models\base.py" in save_base
762.             updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\db\models\base.py" in _save_table
846.             result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\db\models\base.py" in _do_insert
885.                                using=using, raw=raw)
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\db\models\manager.py" in manager_method
127.                 return getattr(self.get_queryset(), name)(*args, **kwargs)
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\db\models\query.py" in _insert
920.         return query.get_compiler(using=using).execute_sql(return_id)
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\db\models\sql\compiler.py" in execute_sql
973.             for sql, params in self.as_sql():
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\db\models\sql\compiler.py" in as_sql
931.                 for obj in self.query.objs
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\db\models\fields\files.py" in pre_save
314.             file.save(file.name, file, save=False)
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\db\models\fields\files.py" in save
93.             self.name = self.storage.save(name, content, max_length=self.field.max_length)
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\core\files\storage.py" in save
63.         name = self._save(name, content)
File "C:\Users\Rebecca\Documents\FINALYEAR\CSbackup\MyActionDefiner3 - 2tblWorking - Copy\MyActionDefiner2\env\lib\site-packages\django\core\files\storage.py" in _save
248.                     fd = os.open(full_path, flags, 0o666)

Exception Type: OSError at /actions/create
Exception Value: [Errno 2] No such file or directory

如果您只需要查看自合并提交以来发生的更改,请在您的git日志中查找合并并按该修订过滤。

git log --name-status --oneline --author='Your Name'

键是git log --name-status --oneline --author='Your Name' <your_commit_hash>..HEAD 标志。

修改

还会有一些其他输出,比如你的提交哈希和消息。 --author允许您仅显示文件名,但它不允许您按作者进行过滤。因此,如果您只想输出文件名并按作者过滤,则可能必须以编程方式执行此操作。