In Gitlab project from the instructions, they tell how to add an existing_folder to Git repository.
But after I press git commit
the console open a vim.
Then how can I go to the last one git push -u origin master
and push my repository to gitlab.
cd existing_folder
git init
git remote add origin [remote url]
git add .
git commit
git push -u origin master
The command git commit
launches your default command line text editor because a commit needs a message describing what is happening in it. There are two ways to add this message:
git commmit -m "Commit message here"
, which allows you add a short commit message in the quotes without launching the editor.A commit message can be anything, but here is an article if you want to go in depth on what should be in a message and how to format it. Sometimes I use the full text editor to write a complex message, sometimes I just need a quick note and use the inline command with the -m
flag.
Want to change the default editor git uses for commit messages? You're in luck! Simply add it to your git config like this: git config --global core.editor "nano"
. Now commit messages will be opened in nano, or whatever editor command you put in this config command.