I was checking the X commits using the following command:
git log --author=<my-name> -<X>
But the problem is that I accidentally pulled code from another repository and added the commits from the repository to my local git repository.
So I cannot use the above command since the new commits contains some other authors.
This message from git means that you have made three commits in your local repo, and have not published them to the master repository. The command to run for that is git push {local branch name} {remote branch name} .
On GitHub.com, you can access your project history by selecting the commit button from the code tab on your project. Locally, you can use git log . The git log command enables you to display a list of all of the commits on your current branch. By default, the git log command presents a lot of information all at once.
To confirm, you can run git branch . The branch that you are on will be the one with a * next to it. Git checkout might fail with an error message, e.g. if it would overwrite modified files. Git branch should show you the current branch and git log master allows you to view commit logs without changing the branch.
We can view the unpushed git commits using the git command. It will display all the commits that are made locally but not pushed to the remote git repository.
The command
git log origin/master..master
shows the commits that are on master
but not on origin/master
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With