Similarly, git uses master as the default branch name. Therefore it’s the standard name for your main server to push to. Note: origin is no special name, it’s just the name git uses for the server when you git clone a repository. If this command lists an error, you likely used the wrong URL for the repository or you don’t use the correct credentials (username/password, SSH key etc).Įvery time you’ve made a commit in order to push it to the server. Therefore we have to tell it using -set-upstream that future git push commands shall automatically push to origin: git push -set-upstream origin master git push by itself won’t work for the first time, because git doesn’t know automatically that you want to push to origin. Now you can push your existing data to the server. The URL (last argument) depends on the server you use, for GitHub, you can get the URL (HTTPS or SSH, both will work) by clicking the green Clone or Download button. This adds a server ( remote add) named origin with the URL :yourusername/yourrepository.git. Remember to replace :yourusername/yourrepository.git with the correct URL for your repository. Then, in the Create a Git repositorydialog box, enter your information. To do so, select Git> Create Git Repositoryfrom the menu bar. Therefore, we’ll have to add a server (called remote in git terminology) to the repository: git remote add origin :yourusername/yourrepository.git Create a new Git repository in Visual Studio 2019 If your code is not associated with Git, you can start by creating a new Git repository. Now that you have made some commits, you want to use git pushīut you get the following error message: fatal: No configured push destination.Įither specify the URL from the command-line or configure a remote repository usingĪs you initialized your repository using git init, git does not know which server to contact when you use git push. You have initialized a git repository in a folder using git init This post is also available in: Deutsch (German ) Problem:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |