-
Notifications
You must be signed in to change notification settings - Fork 3
Common Git command workflow
YASHSVI GIRDHAR edited this page Apr 4, 2023
·
3 revisions
# update local repo
git pull
# display the state of the working directory and the staging area
git status
# create/checkout new branch
git checkout -b <new branch name>
git status
# adds a change in the working directory to the staging area
git add .
git status
# captures a snapshot of the project's currently staged changes
git commit -m "comments go here"
git status
# push branch to origin
git push origin <new branch name>
git status
# switch to the main branch and update local repo
git checkout main
git pull
git branch --delete <branchname>
git checkout main
git pull
git checkout <branch-name>
git merge main
git commit #if it does NOT automatically fast forward