我不完全理解使用Git或Github的目的;我知道这有助于跟踪你的变化,也有助于人们与其他人合作,但我不与任何人合作,所以我不知道这对我是否有帮助。

我通常是一个网页设计师/开发人员,但我从来没有合作过。我知道在Git中,你可以为每个存储库创建、推送、提交、创建分支等,但是……

Git和GitHub有什么区别? git是否将每个存储库保存在本地(在用户的机器中)和GitHub中? 没有GitHub可以使用Git吗?如果是,使用GitHub的好处是什么? Git与Time Machine这样的备份系统相比如何? 这是一个手动过程吗?换句话说,如果你不提交,你就不会有一个新版本的更改? 如果你没有合作,并且你已经使用了备份系统,为什么还要使用Git?


当前回答

What is the difference between Git and GitHub? Linus Torvalds would kill you for this. Git is the name of the version manager program he wrote. GitHub is a website on which there are source code repositories manageable by Git. Thus, GitHub is completely unrelated to the original Git tool. Is git saving every repository locally (in the user's machine) and in GitHub? If you commit changes, it stores locally. Then, if you push the commits, it also sotres them remotely. Can you use Git without GitHub? If yes, what would be the benefit for using GitHub? You can, but I'm sure you don't want to manually set up a git server for yourself. Benefits of GitHub? Well, easy to use, lot of people know it so others may find your code and follow/fork it to make improvements as well. How does Git compare to a backup system such as Time Machine? Git is specifically designed and optimized for source code. Is this a manual process, in other words if you don't commit you wont have a new version of the changes made? Exactly. If are not collaborating and you are already using a backup system why would you use Git? See #4.

其他回答

What is the difference between Git and GitHub? Git is a version control system; think of it as a series of snapshots (commits) of your code. You see a path of these snapshots, in which order they where created. You can make branches to experiment and come back to snapshots you took. GitHub, is a web-page on which you can publish your Git repositories and collaborate with other people. Is Git saving every repository locally (in the user's machine) and in GitHub? No, it's only local. You can decide to push (publish) some branches on GitHub. Can you use Git without GitHub? If yes, what would be the benefit for using GitHub? Yes, Git runs local if you don't use GitHub. An alternative to using GitHub could be running Git on files hosted on Dropbox, but GitHub is a more streamlined service as it was made especially for Git. How does Git compare to a backup system such as Time Machine? It's a different thing, Git lets you track changes and your development process. If you use Git with GitHub, it becomes effectively a backup. However usually you would not push all the time to GitHub, at which point you do not have a full backup if things go wrong. I use git in a folder that is synchronized with Dropbox. Is this a manual process, in other words if you don't commit you won't have a new version of the changes made? Yes, committing and pushing are both manual. If are not collaborating and you are already using a backup system why would you use Git? If you encounter an error between commits you can use the command git diff to see the differences between the current code and the last working commit, helping you to locate your error. You can also just go back to the last working commit. If you want to try a change, but are not sure that it will work. You create a branch to test you code change. If it works fine, you merge it to the main branch. If it does not you just throw the branch away and go back to the main branch. You did some debugging. Before you commit you always look at the changes from the last commit. You see your debug print statement that you forgot to delete.

一定要查看gitimmersion.com。

What is the difference between Git and GitHub? Linus Torvalds would kill you for this. Git is the name of the version manager program he wrote. GitHub is a website on which there are source code repositories manageable by Git. Thus, GitHub is completely unrelated to the original Git tool. Is git saving every repository locally (in the user's machine) and in GitHub? If you commit changes, it stores locally. Then, if you push the commits, it also sotres them remotely. Can you use Git without GitHub? If yes, what would be the benefit for using GitHub? You can, but I'm sure you don't want to manually set up a git server for yourself. Benefits of GitHub? Well, easy to use, lot of people know it so others may find your code and follow/fork it to make improvements as well. How does Git compare to a backup system such as Time Machine? Git is specifically designed and optimized for source code. Is this a manual process, in other words if you don't commit you wont have a new version of the changes made? Exactly. If are not collaborating and you are already using a backup system why would you use Git? See #4.

What is the difference between Git and GitHub? Git is a distributed version control system. It usually runs at the command line of your local machine. It keeps track of your files and modifications to those files in a "repository" (or "repo"), but only when you tell it to do so. (In other words, you decide which files to track and when to take a "snapshot" of any modifications.) In contrast, GitHub is a website that allows you to publish your Git repositories online, which can be useful for many reasons (see #3). Is Git saving every repository locally (in the user's machine) and in GitHub? Git is known as a "distributed" (rather than "centralized") version control system because you can run it locally and disconnected from the Internet, and then "push" your changes to a remote system (such as GitHub) whenever you like. Thus, repo changes only appear on GitHub when you manually tell Git to push those changes. Can you use Git without GitHub? If yes, what would be the benefit for using GitHub? Yes, you can use Git without GitHub. Git is the "workhorse" program that actually tracks your changes, whereas GitHub is simply hosting your repositories (and provides additional functionality not available in Git). Here are some of the benefits of using GitHub: It provides a backup of your files. It gives you a visual interface for navigating your repos. It gives other people a way to navigate your repos. It makes repo collaboration easy (e.g., multiple people contributing to the same project). It provides a lightweight issue tracking system. How does Git compare to a backup system such as Time Machine? Git does backup your files, though it gives you much more granular control than a traditional backup system over what and when you backup. Specifically, you "commit" every time you want to take a snapshot of changes, and that commit includes both a description of your changes and the line-by-line details of those changes. This is optimal for source code because you can easily see the change history for any given file at a line-by-line level. Is this a manual process, in other words if you don't commit you won't have a new version of the changes made? Yes, this is a manual process. If are not collaborating and you are already using a backup system why would you use Git? Git employs a powerful branching system that allows you to work on multiple, independent lines of development simultaneously and then merge those branches together as needed. Git allows you to view the line-by-line differences between different versions of your files, which makes troubleshooting easier. Git forces you to describe each of your commits, which makes it significantly easier to track down a specific previous version of a given file (and potentially revert to that previous version). If you ever need help with your code, having it tracked by Git and hosted on GitHub makes it much easier for someone else to look at your code.

对于开始使用Git,我推荐在线书籍Pro Git和GitRef作为方便的参考指南。对于开始使用GitHub,我喜欢GitHub的Bootcamp和他们的GitHub指南。最后,我创建了一个短视频系列,向初学者介绍Git和GitHub。