Please see following screen details - git remote -v command is showing that I have test_vishwas added but when I am giving Push command it is giving error. Anybody can help ?
C:\Users\vishwas_gupta03\Documents\GitHub\test_Vishwas [master]> git remote -v github https://github.com/vishwasjione/test_Vishwas.git (fetch) github https://github.com/vishwasjione/test_Vishwas.git (push) origin C:\Users\vishwas_gupta03\Documents\GitHub\test_Vishwas [master]> git push fatal: No configured push destination. Either specify the URL from the command-line or configure a remote repository us ing git remote add <name> <url> and then push using the remote name git push <name> C:\Users\vishwas_gupta03\Documents\GitHub\test_Vishwas [master]>
Run the git remote set-url --add --push origin git-repository-name command where git-repository-name is the URL and name of the Git repository where you want to host your code. This changes the push destination of origin to that Git repository.
Push a new Git branch to a remote repo Clone the remote Git repo locally. Create a new branch with the branch, switch or checkout commands. Perform a git push with the –set-upstream option to set the remote repo for the new branch. Continue to perform Git commits locally on the new branch.
In the command line, navigate to the root directory of your project. Initialize the local directory as a Git repository. To create a repository for your project on GitHub, use the gh repo create subcommand. When prompted, select Push an existing local repository to GitHub and enter the desired name for your repository.
Try this:
git push -u github master
This will set your local master
branch to track the master
branch on the github
remote.
Next time you push this branch, you should be able to use the shorter command git push
.
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