Helpful Git Commands
·120 words·1 min
Table of Contents
What your setup should look like (git remote -v) #
origin git@github.com:JakeRoggenbuck/ClubApp.git (fetch)
origin git@github.com:JakeRoggenbuck/ClubApp.git (push)
upstream git@github.com:aggieworks/ClubApp.git (fetch)
upstream git@github.com:aggieworks/ClubApp.git (push)
Getting information #
# list the remotes
git remote -v
# check your staging area
git status
# check commits
git log
Update from latest #
# make sure you are on your own main and don't have any current changes
git switch main
git pull upstream main
Before a feature/assignment/change #
This should be done before the start of any distinct feature or large change.
git switch main
git pull upstream main
git switch -c feature-name
Submitting a feature/assignment/change #
# add all changed but prevously staged files
git add -u
git commit
git push origin feature-name