简体   繁体   English

从 Git 开始 - 个人提交和推送? 还是一次性全部?

[英]Starting with Git - individual commits and pushes? Or all at once?

We were just setup with a Git-TFS solution at my work.我们刚刚在我的工作中设置了 Git-TFS 解决方案。 Up until now, important files were kept on network shares, in a format like so:到目前为止,重要文件都保存在网络共享中,格式如下:

  • Filex V1 20180101.zzz Filex V1 20180101.zzz
  • Filex V2 20181201.zzz Filex V2 20181201.zzz
  • Filex V3 20190101.zzz Filex V3 20190101.zzz

Obviously I will rename the file to Filex before copying into the repository, starting with the oldest.显然,在复制到存储库之前,我会将文件重命名为Filex ,从最旧的开始。
My question is, do I need to perform a Commit AND Push for each file-version I drop in my repository?我的问题是,我是否需要为我放入存储库的每个文件版本执行提交和推送? Or just Commit, and Git will see them as different versions?或者只是提交,Git 会将它们视为不同的版本?

git commit : This command will commit the changes to your local repository. git commit :此命令会将更改提交到您的本地存储库。

git push : This command will push your local commits to the remote repository. git push :此命令会将您的本地提交推送到远程存储库。

There is no need to do git push every time when the file content is changed , just do a git commit whenever you change the file and do a git push, after you are done with all your changes无需每次更改文件内容时都执行 git push ,只需在更改文件时执行 git commit 并在完成所有更改后执行 git push

For example.例如。

  1. Add a file to your repo folder.将文件添加到您的 repo 文件夹。
  2. git add and git commit. git add 和 git commit。
  3. Add a new version of the file添加文件的新版本
  4. git add and git commit git add 和 git commit
  5. Repeat step 3 and 4, till you reach the latest version.重复第 3 步和第 4 步,直到达到最新版本。
  6. Do a git push做一个 git push

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM