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
In GitLab, create a project to hold your files. Visit this project's homepage, scroll down to Push an existing folder , and copy the command that starts with git remote add .
git init Existing Folder For an existing project to become a Git repository, navigate into the targeted root directory. Then, run git init . Or, you can create a new repository in a directory in your current path. Use git init <directory> and specify which directory to turn into a Git repository.
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.
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