开发者

Managing a local/clone copy of a project with git

开发者 https://www.devze.com 2023-02-17 05:26 出处:网络
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,

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.


  1. You can use git reset or git checkout (with the right parameters) to go to a old state of the tree. reset changes what the current branch points to, while checkout leaves the branch and switches to another, or to a commit not on a branch.

  2. Yes. Just have an own branch, into which to merge (or not merge).

  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消