Does git push origin master do exactly the same thing as git push?
1 Answer
git push alone has been deprecated (not supported) for some time, because it is implicit, rather than explicit.
It is better practice, and not to mention much safer (will likely stop you from accidentally pushing the wrong branch to the wrong remote).
Thus, it is best to use git push <remote> <branch>
6 Comments
Bob5421
Okay but was it the same thing before been deprecated ?
Bob5421
and git pull without arguments is deprecated too ?
rst-2cv
AFAIK,
git push pushed the currently checked-out branch to the origin remote. So, if git status said you were in the master branch, and git remote -v returned the remote origin, then git push would be the same as git push origin masterrst-2cv
Yes I believe
git pull without any arguments is also deprecated.phd
@RThomP Can you provide a reference for deprecation? I've never heard about deprecated bare
git pull/push, docs don't say anything and search reveals nothing. |