[英]Pull latest changes from origin/master after push to origin/master
Currently I can push to my remote repository (from local), which updates the remote origin master branch.目前我可以推送到我的远程存储库(从本地),这会更新远程原始主分支。 I can see the changes immediately in github.
我可以立即在 github 中看到变化。
If I create a new file from my local repo, add, commit and push to the remote I would like the remote to instantly receive that file after push:如果我从我的本地仓库创建一个新文件,添加、提交并推送到远程,我希望远程在推送后立即接收该文件:
local_repo
-------------
README.md
test1.txt
test2.txt # This is a new file that should appear on the remote after push
However, although Github is updated with the new file instantly, the remote repo isn't updated before I pull the latest changes:然而,虽然 Github 会立即更新为新文件,但在我提取最新更改之前,远程仓库不会更新:
remote_repo (after local push to remote, before remote pull)
------------
README.md
test1.txt
The remote repo shows the most recent changes after pulling from master:远程 repo 显示从 master 拉取后的最新更改:
remote_repo (after local push to remote, and after remote pull)
-------------
README.md
test1.txt
test2.txt
How can I have the remote automatically pull and receive the latest changes from its own master branch?我怎样才能让远程自动从它自己的 master 分支中拉取和接收最新的更改?
EDIT: My use case and additional details below ****************编辑:我的用例和下面的其他详细信息 ****************
I have a game server with many files, which lives on my cloud server (VPS).我有一个包含许多文件的游戏服务器,它位于我的云服务器 (VPS) 上。 Traditionally, I would update / add new files by uploading via FTP. I'm looking to replace that workflow with version control.
传统上,我会通过 FTP 上传来更新/添加新文件。我希望用版本控制替换该工作流。
How can I have remote_repo receive the latest changes from remote origin without manually going into the repo and pulling after every push?我怎样才能让 remote_repo 从远程源接收最新的更改,而无需手动进入 repo 并在每次推送后拉出?
you can create a shell script that does:您可以创建一个 shell 脚本来执行以下操作:
git push
git fetch
and run it instead of git push并运行它而不是 git 推送
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.