Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools).Git fatal: protocol 'https' is not supported.Does the target directory for a git clone have to match the repo name?.#ProTip, use msysgit and turn on Quick Edit mode on in the terminal properties, so that you can double click to highlight a line of text, right click to copy, and right click again to paste. You should really learn how to use Git from the command line anyways though, it'll make you more proficient in Git. This also assumes that BitBucket will allow you to force push to a repo. If that's okay, then you might need to use the following command at the command line to do the force push, because I couldn't find an option to do it in SourceTree: git push remote-repo head -f However, assuming that you're the only person working on the repo, then the next thing you would want to do is force push your changed history to the remote.īe aware, though, that because you did a hard reset to the faulty commit, then force pushing causes you to lose all work that come after it previously. If it's not possible because it's already pushed to Bitbucket, I would not mind creating a new repository and starting over.ĭoes this mean that you're the only person working on the repo? This is important because it's not trivial to change the history of a repo (like by amending a commit) without causing problems for your collaborators. Make the changes you want to the message, then click Commit again.Click on the checkbox at the bottom that says "Amend latest commit".Do a hard reset in SourceTree to the bad commit by right-clicking on it and selecting Reset current branch to this commit, and selecting the hard reset option from the drop down.Since you mentioned in the comments that you don't mind "reverting back to the faulty commit" (by which I assume you actually mean resetting, which is a different operation in Git), then here are the steps: That being said, here's one way you can do it in SourceTree. One way to solve the problem in SourceTree You set which terminal SourceTree uses (bash or Windows) here: Either way, you open it up form SourceTree by clicking the Terminal button: SourceTree might actually come with the msysgit bash shell already, or it might be able to use the standard Windows command shell. I suggest you check out one of the answers in How do I edit an incorrect commit message in Git?, Git is flexible enough that there are multiple om the command line. Regarding Git GUIs, no, they don't cover all of Git's functions. Original AnswerĪs I'm on Windows I don't have a command line tool nor do I know how to use one :( Is it the only way to get that sorted out? The GUI doesn't cover all the git's functions? - Original Poster I'm leaving this answer behind for historical purposes. See my new answer for the current version of SourceTree for Windows, 1.5.2.0. Note: this answer was originally written with regard to older versions of SourceTree for Windows, and is now out-of-date. Also use :wq to save&quit.įinally: In the sourcetree main window, Press F5 to refresh. Now, a new vi window will be open, in this window you input your new message. Then, input :wq to save&quit that vi window. This command will open a vi window, the first word of each line is " pick", and you change the "pick" to " reword" for the line you want to edit. if you want to edit the message before the last one, n is 2. : target commit is not the latest one.ġ) In the git command console, input git rebase -i HEAD~n In the git command console, input git push -force : target commit is the latest one.ġ) In the git command console, input git commit -amend -m "new comment message"Ģ) If the target commit has been pushed to remote, you have to push again by force. Step1: In the sourcetree main window, locate your repo tab, and click the " terminal" button to open the git command console. (tested under sourcetree Ver2.5.5.0)ĬAUTION: if the commit has been pulled by other members, changes below might cause chaos for them. If the comment message includes non-English characters, using method provided by user456814, those characters will be replaced by question marks.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |