Skip to content

Instantly share code, notes, and snippets.



Last active May 11, 2020
What would you like to do?
Git workflow

1. Create new branch with changes in master

git checkout -b [feature branch name]

2. Add changes and Commit

git commit -a -m "Commit message"

3. Push changes to remote

git push origin [feature branch name]


4. To delete branch

git branch -D [branch name]
git push origin --delete [branch name]

5. Replace local branch with remote

git reset --hard origin/master

6. Remove all untracked files

git clean -fd

7. (Replace your local with current remote state) - Removes your local changes

git reset origin master 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment