Skip to content

Instantly share code, notes, and snippets.

@bo858585
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bo858585/b33af90c3c84255c62a2 to your computer and use it in GitHub Desktop.
Save bo858585/b33af90c3c84255c62a2 to your computer and use it in GitHub Desktop.
How to work with non-local branches for the warranty of the commit atomicity (possible strategy/man):
# Create branch from master/development/another working branch
git checkout -b branch_name
# Write code
# Add code to commit
# (Use a/u (add/update) options of the interactive command for adding new files/updating existing files)
git add -i
# Create commit
git commit
# Simply push commit to non-local branch:
git push origin branch_name
# Add code to commit
# (Use a/u (add/update) options of the interactive command for adding new files/updating existing files)
git add -i
# Complete commit
git commit --amend
# Push completed commit to server
git push origin branch_name -f
# Then you will have single commit at server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment