简体   繁体   English

如何在执行提交时确保git config文件被推送到仓库?

[英]How can I make sure git config file gets pushed to repo when doing commits?

I changed git config file on my working machine. 我在工作机器上更改了git config文件。

I changed some code, committed it. 我更改了一些代码,将其提交。

When I come home, how can I pull the config file into my home station? 当我回到家中时,如何将配置文件拉入我的家中工作站?

The git config file is inside a repository's .git folder. git config文件位于存储库的.git文件夹中。 This folder is not part of the repository itself. 该文件夹不是存储库本身的一部分。 Thus, changes on the config file will not be commited and pushed and subsequently, you won't be able to acquire it via git pull . 因此,将不会提交和推送对config文件的更改,随后,您将无法通过git pull获取它。

If you want to have a configuration file that gets shared via your remote repository, take a look at this question . 如果您希望有一个通过远程存储库共享的配置文件,请查看此问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将数据推送到裸git仓库时,如何自动将数据推送到git-repo? - How can I automatically push the data to a git-repo when it's pushed to a bare git repo? 如何通过Git中的其他推送提交对特定分支进行单个提交? - How can I make a single commit of specific branch from other pushed commits in Git? 在Git中,如何重新排序(更改)推送提交? - In Git, how can I reorder (changes from) pushed commits? 如何使用 git 撤消推送的提交? - How can I undo pushed commits using git? 如果将提交提交到远程仓库中的git中,可以删除它们(在任何情况下) - Will the commits can be deleted (in any case) if they are pushed in git in remote repo 如何修复我的本地存储库,以便我可以保存尚未推送到主 git 存储库的提交的工作? - How do I fix my local repo so I can save work from commits that haven’t been pushed to the master git repo? git:如何以编程方式判断回购协议是否可以推送? - git: how can I programmatically tell if a repo can be pushed? GIT:如何压缩已被推送到远程仓库的几个提交? - GIT: how to squash several commits that have been pushed to a remote repo? 如何在 Git 存储库中为所有提交移动目录? - How can I move a directory in a Git repo for all commits? 如何加入两个推送的提交? - How can I join two pushed commits?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM