Andrew Fletcher published: 17 June 2022 1 minute read
When attempting to do a git push, are you getting the following response:
fatal: The current branch main has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin main
Quick solution, instead run the command
git push origin main
And the response will push what you were attempting to do
Enumerating objects: 34, done.
Counting objects: 100% (34/34), done.
Delta compression using up to 8 threads
Compressing objects: 100% (19/19), done.
Writing objects: 100% (19/19), 5.64 KiB | 2.82 MiB/s, done.
Total 19 (delta 15), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (15/15), completed with 15 local objects.
Related articles
Andrew Fletcher
•
11 Jul 2022
How to synchronize two remote Git repositories
Currently, I have a situation where I have two repositories. The first is where I've held the code since the beginning. The second has come on board recently and is the client repo. However, rather than shut the original down, I want to keep both running with the same code....
Andrew Fletcher
•
09 May 2022
Creating then adding a key to the remote repository
In this woalk through I am going to use GitHub. However, the steps are similar to a Bitbucket profile.
Logged in to your GitHub account, click your profile icon, located (at the time of this writing) on the top right corner.
Select Settings
Click SSH and GPG...
Andrew Fletcher
•
11 Jun 2021
Starting a new GitHub repository including having to merge
Wanting to create a new repository on GitHub, add in a few of the available options that can come with an initial repository such as:
.gitignore for the platform you are building on
README.md for detailed notes - particularly if the repository if public
LICENSE - again important if the...