Skip to content

Instantly share code, notes, and snippets.

@namzo
Last active May 11, 2020 21:43
Show Gist options
  • Save namzo/46188c2872db03b2f3da2bc79e609c06 to your computer and use it in GitHub Desktop.
Save namzo/46188c2872db03b2f3da2bc79e609c06 to your computer and use it in GitHub Desktop.
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