Git commands for development workflow

1. checkout remote dev branch to local

git checkout -b local_dev_branch origin/dev

2. after modified, submit to local, the example shows submit modified java files.

git commit -m *.java "modified java files"

3. after submit code in local, you can submit own branch to remote, the branch name can be same with local branch name and waiting for review, local_dev_branch_for_remote is remote branch name

git push origin local_dev_branch:local_dev_branch_for_remote

4. Loop step 2-3 when need further modify after review, after reviewed and merged to dev branch, you can delete remote branch

git push --delete origin local_dev_branch_for_remote

5.Then delete local branch

# change to other branch before delete
git checkout other_local_branch
# delete
git branch -D  local_dev_branch

Leave a Reply

Your email address will not be published. Required fields are marked *