GIT COMMANDS
MAHESH SAVANT
steps to local file to remote file or GITHUB
STEP 1 : first create file go into file by using main line or --- command
cd file name
mk newfilename
STEP 2 :
git status
STEP 3 :
git add .
STEP 4 :
git commit -m "committed this file"
STEP 5 : git push
git push origin main
STEP 1: Check Which Branch you Work on
git branch
STEP 2: create new branch
git checkout -b brachname
STEP 3: move to other branch
git checkout branchname
STEP 4: Delete any branch
git branch -d branchname
STEP 5: Push Any other branch
git push origin branchname
STEP 6: Marging any Brach into main branch or master branch
git marge branch oppositebranchname
---------- other Method is PR (Pull Request)----------
====> this method in Github app only.
====> Pull requset to main branch holder.
====> holder reviwes the Code Than marge its .
====> remote change --> Local Changes
====> by using PULL COMMAND
git pull origin filename
---------------------------------------------------
git log
---------------------------------------------------
case 1: staged changes
git reset filename
git reset
case 2: commited changes (for one commit)
git reset HEAD~1
case 3: commited change (for many commits)
git reset <commite-hash>
commit hash example -> git log -> check hash(abf45b11ae9c9f61d38a5b7a5e66d3260327389c)
git reset --hard <commit-hash>