I'm learning using Git on an OS X Terminal. It seems really easy. But I can't handle just one problem: When I try to merge two branches, for example "myTestBranch" into "master" this program covers the terminal and shows me a new view where I should write the merge message. And then, I don't know how to do "Enter", save the merge message and then come back to the main terminal view where I can continue working.
Does anyone know, how does it work?
Committing via the Command Palette Open the Command Palette. Run the Git: Commit command (type commit and press Enter ) (Optional) Choose the files you would like to commit. Click on Commit or hit Ctrl + Enter (or Cmd + Enter on your Mac)
To add a Git commit message to your commit, you will use the git commit command followed by the -m flag and then your message in quotes. Adding a Git commit message should look something like this: git commit -m “Add an anchor for the trial end sectionnn.”
Set a template: Open Settings > Tools > Commit Message Template and enter the desired template or set the path to a template file.
If you haven't change the default git's editor, that "new view" is the Vi program.
To save your commit message using Vi, follow the next steps:
i
ESC
key:wq
Typing :q
, step 4, is not enough beacuse just means QUIT without saving. That's why you need :wq
, which means WRITE and QUIT.
You can write your commit message using your favourite editor(vim, emacs, etc.). To achieve this, you can use configuration parameter or environment variables, listed in order:
Using the configuration option type something like this:
$git config --global core.editor "nano"
Or if you want to use enviroment variables, add something like this to your .bash_profile
$export GIT_EDITOR="PATH/TO/YOUR/EDITOR"
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