- It helps you to compare the source code of the forked repository with the source code of the source repository.
- It also helps you to see the changes made in the source repository.
Open a Git Bash terminal.
Change directory to the directory where you have cloned the repository.
Check out the source branch.
git remote add repo_name url_of_source_repository
Runnning the command will add a remote repository named "repo_name" to the local repository.
Fetch the source branch.
git fetch repo_name master
Runnning the command will fetch the master branch from the remote repository.
To compare the two repositories, you can use the following command:
git diff --stat origin/master repo_name/master
--stat shows the number of added, deleted, and modified lines and not the actual content of the files. Don't use
--stat if you want to see the actual content of the files.
To see the latest commits in the source repository, you can use the following command:
git log [--oneline] [--graph] [--after=date] [--before=date] [--author=author] repo_name/master
--oneline shows the commit message.
--graph is used to show the commit graph.
--after=date shows the commits after the date.
--before=date shows the commits before the date.
--author=author shows the commits made by the author.
There can be many more options to filter the commits. Check the Git log documentation for more information.
Thank you for reading! If you want to connect with me, you can find me on Twitter @abh1navv