0

I want to clone POX Controller from Github repository into my laptop. The only way I know is by cloning. However, I think if someone clone a project, he/she won't get the updates that the others have done in it. I have read about forking but I don't really understand the difference between fork and clone. So how do I get a project from Github and still be able to receive updates?

Thank you.

Alli
  • 53
  • 1
  • 2
  • 6

1 Answers1

0

To clone a repository means that you will download the whole code of the repository to your laptop.

A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.

Most commonly, forks are used to either propose changes to someone else's project or to use someone else's project as a starting point for your own idea. More at Fork A Repo.

as @TimBiegeleisen says, you can get the project and stay updated by clone once then git fetch it periodically.

For example, if you want to cloning POX Controller, clone it:

git clone https://github.com/noxrepo/pox

Then to update it, do the following command on your cloned project:

cd pox // go to your clone project
git fetch

Or you can use git pull instead of git fetch if only need to stay update without keeping your change in the cloned project.

But you must remember the difference between git fetch and git pull. @GregHewgill answers explain it in details:

In the simplest terms, git pull does a git fetch followed by a git merge. You can do a git fetch at any time to update your remote-tracking branches under refs/remotes/<remote>/. This operation never changes any of your own local branches under refs/heads, and is safe to do without changing your working copy. I have even heard of people running git fetch periodically in a cron job in the background (although I wouldn't recommend doing this).

A git pull is what you would do to bring a local branch up-to-date with its remote version, while also updating your other remote-tracking branches.

Git documentation: git pull

Community
  • 1
  • 1
ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96