Last active
October 29, 2024 08:03
-
-
Save mataralhawiti/1ce9d92c186071a0e166278c3ff060a9 to your computer and use it in GitHub Desktop.
git commands helpers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### merge | |
- on dev: | |
git checkout master | |
then : | |
git merge dev | |
### create local branch then push it to the remotre | |
git checkout -b feature/tf-environments | |
then : | |
git push --set-upstream origin feature/tf-environments | |
### restore staged (committed) cahnges | |
git restore --staged xxxxx.py | |
### restore | |
git restore xxxxx.py | |
git restore . | |
### tag | |
git tag v1.0 | |
git push origin v1.0 | |
### fetch all remote branches | |
git fetch --all | |
for branch in `git branch -r | cut -d '/' -f2-` ; do git checkout $branch && git pull origin $branch ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment