Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does "git push origin @" not work?

Tags:

People also ask

How do I force git to push origin?

To force a push to only one branch, use a + in front of the refspec to push (e.g git push origin +master to force a push to the master branch).

How do I push my origin code?

To push the branch or you can say to push the changes in the branch to the Github repo you have to run this command “git push origin <the branch name>” in our case the branch name is “main”. After pushing the changes the repo will look like and this is how you can push a branch to a remotely hosted GitHub repository.

What are the issues when git push doesn't work?

You need to use git pull and resolve the difference between your local changes and the remote changes before you can git push . There is still a commit in the remote branch initializing the repo that may not be in your local version.


We can push the head of a branch like below

$ git push origin HEAD

And, we can use @ for alias of HEAD.

$ git show @

Then why does the below command gives me an error?

$ git push origin @
fatal: remote part of refspec is not a valid name in @