liveBook · Manning

Git push

As explained in Build Python Web Apps with Streamlit

The git push command transfers local commits to a configured remote Git repository.

git push transfers commits from a local branch to a configured remote repository, making the code available there. A typical first push uses git push -u origin master. section 5.2.2

Use the first push to establish the relationship between the local and remote branches:

  • Push the current local branch to the remote named origin. section 5.2.2
  • Use -u, short for --set-upstream, so later pushes can use git push without repeating the remote and branch. section 5.2.2
  • Replace master with main when that is the repository’s branch name; git branch shows the current branch. section 5.2.2

Publish a local app

After initializing, adding, and committing a local project, configure its GitHub remote and run git push -u origin master. Open the repository on GitHub to verify that the code arrived. section 5.2.2

Figure 5.7 Repo in GitHub after pushing the code

Inspect the repository after pushing to confirm that the code is present on GitHub. section 5.2.2

How Build Python Web Apps with Streamlit covers it

How deep it goes
Explains branch transfer and upstream configuration, then stops at the minimum Git workflow needed for deployment.
Examples
Uses git push -u origin master and verifies the resulting repository on GitHub.
What it assumes
Assumes a local repository, committed code, a configured remote, and awareness that repositories may use master or main.
What you can do after
Operate Git to publish a committed local branch and configure later pushes with a default upstream.
How it connects
Connects Git branches, remote repositories, GitHub, commits, and Streamlit Community Cloud deployment.

Also explained in

Compare how 3 books explain git push →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Python Web Apps with Streamlit. The section links point to the parts of the book it draws on.