Cleanup all local branches except master
for /f "delims=" %i in ('git branch ^| findstr /v "develop"') do git branch -D %i
Other basic commands
Merge Latest develop Branch into Current Branch
git checkout develop
git pull origin develop
git checkout <your-current-branch>
git merge develop
Create a New Branch
git checkout -b new-branch-name
Switch to an Existing Branch
git checkout existing-branch-name
Delete a Local Branch
git branch -d branch-name
Delete a Remote Branch
git push origin --delete branch-name
View Commit History
git log
View Branches
git branch -a
Stage All Changes for Commit
git add .
Commit Changes
git commit -m "Your commit message"
Push Changes to Remote Repository
git push origin branch-name
Pull Changes from Remote Repository
git pull origin branch-name
Rebase Current Branch onto Another Branch
git checkout your-branch
git rebase branch-to-rebase-onto
Stash Changes
git stash
Apply Stashed Changes
git stash apply
No comments:
Post a Comment