I want to know what commit a specific project was forked from its parent so I can fork from the same commit number.
How can I achieve this?
More specifically, I want to know the commit number of when
https://github.com/superbitcoin/SuperBitcoin
was forked from
First clone one of the repositories:
git clone https://github.com/superbitcoin/SuperBitcoin.git
The superbitcoin/SuperBitcoin repository is your origin
. Now add the other repository as a second remote and fetch
its commits:
cd SuperBitcoin
git remote add upstream https://github.com/bitcoin/bitcoin.git
git fetch upstream
Now you can use merge-base
, as suggested by max630 in the comments:
git merge-base origin/master upstream/master
Note that you must compare specific branches.
This gives c2704ec98a1b7b35b6a7c1b6b26a3f16d44e8880
, which is the last common commit between the two branches. You can see this commit in each repository .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.