Push & Pull

Push local changes to remote repo

$ git push origin <branch name> 

# e.g. git push origin main -> this will push to main branch
# e.g. git push origin dev1 -> this will push to dev1 branch (make sure you switch to this branch before pushing)

Pull changes from remote repo into the current branch

$ git pull origin main

# This command retrieves the changes from the main branch of your remote repository and merges them with your local main branch. However, if you are on a different branch, such as "dev1", the command will merge the changes from the remote main branch into your local "dev1" branch instead.

Note: pull is a combination of fetch and merge.

Last updated