Skip to content

Instantly share code, notes, and snippets.

@mataralhawiti
Last active October 29, 2024 08:03
Show Gist options
  • Save mataralhawiti/1ce9d92c186071a0e166278c3ff060a9 to your computer and use it in GitHub Desktop.
Save mataralhawiti/1ce9d92c186071a0e166278c3ff060a9 to your computer and use it in GitHub Desktop.
git commands helpers
### 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