我想做一个提交
git commit --author="John Doe <john@doe.com>" -m "<the usual commit message>"
Run Code Online (Sandbox Code Playgroud)
其中John Doe是我想要提交其名称的某个用户.
看起来好像在git log.但是,当我这样做时gitk,作者姓名是正确的,但是从我的全局git配置设置中选择了提交者名称(因此设置为我的姓名/电子邮件).
两者之间有什么区别(提交者与作者)?
我是否应该将提交者设置为其他用户?
如果有,怎么样?
我在自己的项目中工作,现在每个人都为第三方做一些工作,我需要在提交中使用他们的联系信息等.我通常只使用全局提交名称等,但现在我需要根据目录指定提交名称和电子邮件.我怎么能在Git中做到这一点?
也许有用的相关信息
我想使用Java API从GitHub获取所有提交。到目前为止,我设法创建了以下简单代码:
import java.io.IOException;
import java.util.List;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.client.GitHubClient;
import org.eclipse.egit.github.core.service.RepositoryService;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
public class GithubImplTest
{
public void testSomeMethod() throws IOException
{
GitHubClient client = new GitHubClient();
client.setCredentials("sonratestw@gmail.com", "sono");
RepositoryService service = new RepositoryService(client);
List<Repository> repositories = service.getRepositories();
for (int i = 0; i < repositories.size(); i++)
{
Repository get = repositories.get(i);
System.out.println("Repository Name: " + get.getName());
}
}
}
Run Code Online (Sandbox Code Playgroud)
如何从该帐户将所有提交提交到存储库中?