RE: What does “git push origin master” exactly do?
"git push origin master" is a command that sends the commits you have made on your 'master' branch to the 'origin' remote repository. Let's break it down: 1. 'git': Git is a version control system that lets you manage and keep track of your source code history. 2. 'push': This is a command in Git that sends your changes to the central repository. It's essentially the command that uploads your code to the repository. 3. 'origin': This is the default name Git gives to the server where your repository was cloned from. It's essentially a shorthand name for the remote repository's URL. 4. 'master': This is the default branch name in Git till version 2.27.0. However, since Git version 2.28.0, the default branch name is 'main'. It's where all the development usually happens and from where new branches are often created. So essentially, when you say "git push origin master", you are saying "take my code from the 'master' branch and send it to the 'origin'" - which is your central repository. Remember, before pushing changes, you should have pulled any changes from the remote repository to ensure you're not overwriting work. This is achieved with 'git pull origin master'.