There are a couple of projects I am interested to work with and they are all in github, so I need a basic understanding. So far I manage to setup git and grab a copy of the project** using git clone, I get updates by calling git pull, but I need to know:
开发者_如何转开发1- How can I reverse to a previous state of the project after a git pull?
2- Is it possible with my setup** to get the latest updates in a different place, test and them merge if I am happy with the changes? how?
3- Do you recommend to Fork the project, even if I wont be contributing to it?
That is it for the moment, many thanks!
** Please note that I am not Forking the project, so I don't have a Copy of the Repo remotely, if that makes sense.
You can use
git reset
orgit checkout
(with the right parameters) to go to a old state of the tree.reset
changes what the current branch points to, whilecheckout
leaves the branch and switches to another, or to a commit not on a branch.Yes. Just have an own branch, into which to merge (or not merge).
Forking has a github specific meaning here - it means that under your name is another repository, which then helps tracking the upstream one - and github rememembers from which repository it came from, draws the right diagrams and so on. As long as you never commit anything different than upstream, there is not really a point, apart from showing that you follow this repository.
精彩评论