Merge up to a specific commit
2022-11-21
Question I created a new branch named newbranch from the master branch in git. Now I have done some work and want to merge newbranch to master; however, I have made some extra changes to newbranch and I want to merge newbranch up to the fourth-from-the-last commit to master. I used cherry-pick but it shows the message to use the right options: git checkout master git cherry-pick ^^^^HEAD newbranch Can I use git merge to do it instead?…
fatal: The current branch master has no upstream branch
2022-11-19
Question I'm trying to push one of my projects to github, and I keep getting this error: peeplesoft@jane3:~/846156 (master) $ git push fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master So I tried it and got this: peeplesoft@jane3:~/846156 (master) $ git push --set-upstream origin master fatal: Authentication failed Another stackoverflow thread suggested I try the following, with disappointing results.…
Git error: "Please make sure you have the correct access rights and the repository exists"
2022-11-19
Question I am using TortoiseGit on Windows. When I am trying to Clone from the context menu of the standard Windows Explorer, I get this error: Please make sure you have the correct access rights and the repository exists More precisely, the snapshot of terminal is the following: git.exe clone --progress -v "git@arobotdev:\git\AlfaRobot.git" "C:\Work\AlfaRobot" Cloning into 'C:\Work\AlfaRobot'... Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,password). fatal: Could not read from remote repository.…
Git: "please tell me who you are" error
2022-11-19
Question I have app servers that I bootstrap together using Chef + some ad-hoc bash scripts. The problem is, when I want to run an update on one of these app servers, I get: 19:00:28: *** Please tell me who you are. Run git config –global user.email “you@example.com” git config –global user.name “Your Name” Do I really need to set this for doing a simple git pull origin master every time I update an app server?…
Complex Git branch name broke all Git commands
2022-11-18
Question I was trying to create a branch from master with the following command, git branch SSLOC-201_Implement___str__()_of_ProductSearchQuery when Git suddenly stopped responding. I suspect the unescaped () are to blame, somehow. Now, whenever I try to run any Git command, I get the same error: git:176: command not found: _of_ProductSearchQuery with the number after git increasing every time I type a command. Can anyone explain what happened? And how do I get back to normal?…
How can I set up an editor to work with Git on Windows?
2022-11-18
Question I'm trying out Git on Windows. I got to the point of trying "git commit" and I got this error: Terminal is dumb but no VISUAL nor EDITOR defined. Please supply the message using either -m or -F option. So I figured out I need to have an environment variable called EDITOR. No problem. I set it to point to Notepad. That worked, almost. The default commit message opens in Notepad.…
Merge two Git repositories without breaking file history
2022-11-18
Question I need to merge two Git repositories into a brand new, third repository. I've found many descriptions of how to do this using a subtree merge (for example Jakub Narębski's answer on How do you merge two Git repositories?) and following those instructions mostly works, except that when I commit the subtree merge all of the files from the old repositories are recorded as new added files. I can see the commit history from the old repositories when I do git log, but if I do git log <file> it shows only one commit for that file - the subtree merge.…