List Git commits not pushed to the origin yet [duplicate]
2022-08-27
Question This question already has answers here: </div> Closed 10 years ago. Possible Duplicate: Viewing Unpushed Git Commits How do I list all commits which have not been pushed to the origin yet? Alternatively, how to determine if a commit with particular hash have been pushed to the origin already? Answer git log origin/master..master or, more generally: git log <since>..<until> You can use this with grep to check for a specific, known commit:…
How to get Git to clone into current directory
2022-08-26
Question I'm doing: git clone ssh://user@host.com/home/user/private/repos/project_hub.git ./ I'm getting: Fatal: destination path '.' already exists and is not an empty directory. I know path . already exists. And I can assure that directory IS empty. (I do ls inside and I see nothing!) What am I missing here in order to clone that project into the current directory ? Answer simply put a dot next to it git clone git@github.com:user/my-project.git .…
Issue with adding common code as git submodule: "already exists in the index"
2022-08-26
Question I want to add some git submodules. I've received two projects sharing some common code. The shared code was just copied into the two projects. I created a separate git repo for the common code and removed it from the projects with the plan to add it as a git submodule. I used the path option of git submodule add to specify the folder: git submodule add url_to_repo projectfolder but then got the error:…
Checkout another branch when there are uncommitted changes on the current branch
2022-08-25
Question Most of the time when I try to checkout another existing branch, Git doesn't allow me if I have some uncommitted changes on the current branch. So I'll have to commit or stash those changes first. However, occasionally Git does allow me to checkout another branch without committing or stashing those changes, and it will carry those changes to the branch I checkout. What is the rule here? Does it matter whether the changes are staged or unstaged?…
How can I configure KDiff3 as a merge tool and diff tool for git?
2022-08-25
Question Recently I was using GitExtension 2.46, but the Git version that has the same is 1.9.4.msysgit.2. Willing to use only Git commands, I uninstalled GitExtension and install the latest version available of Git and KDiff3. When I make a merge and have conflicts, I run the following command: git mergetool Then I receive the message: The merge tool kdiff3 is not available as 'kdiff3'. I guess it must be by the KDiff3 path.…
How do I access my SSH public key?
2022-08-25
Question I've just generated my RSA key pair, and I wanted to add that key to GitHub. I tried cd id_rsa.pub and id_rsa.pub, but no luck. How can I access my SSH public key? Answer cat ~/.ssh/id_rsa.pub or cat ~/.ssh/id_dsa.pub You can list all the public keys you have by doing: $ ls ~/.ssh/*.pub
How can I create a Git repository with the default branch name other than "master"?
2022-08-23
Question In the Pro Git book, it says “origin” is not special Just like the branch name “master” does not have any special meaning in Git, neither does “origin”. While “master” is the default name for a starting branch when you run git init which is the only reason it’s widely used, “origin” is the default name for a remote when you run git clone. If you run git clone -o booyah instead, then you will have booyah/master as your default remote branch.…