Professional Documents
Culture Documents
Initializing BRANCHing
Starting up Git within a project and getting Isolating work and managing feature development in one
it connected. place.
git init
git branch
Initializes (or starts) your current working directory Lists all current branches. An asterisk (*) will appear
(folder) as a Git repository (repo). next to your currently active branch.
git clone
git branch new-branch
https://www.github.com/username/repo-name
Creates a new branch. You will remain on your currently
Copies an existing Git repo hosted remotely. active branch until you switch to the new one.
https://www.github.com/username/repo-name
Consolidates the creation and checkout of a new branch.
Adds the Git upstream to a URL.
Deletes a branch.
STAGing
Creating files staged after modifying a file and
marking it ready to go in the next commit. COLLABORATING AND SHARING
git status
Downloading changes from another repository or sharing
Checks the status of your Git repo, including files added changes with the larger codebase.
that are not staged.
git push origin main
specific files by name. Fetches and merges any commits from the tracking remote
branch.
Removes a file from staging while retaining changes git merge upstream/main
Commits staged files with a meaningful commit message so Compares modified files that are in the staging area.
that you and others can track commits.
Modifies your commit message. Uses commit id to show the diff between two specific
commits.