Forked from adamloving/git-collaborative-workflow.md
Created
November 5, 2022 18:47
-
-
Save thadeusdev/63da55e4799e6d03df2ce40f0a0e444d to your computer and use it in GitHub Desktop.
Revisions
-
adamloving revised this gist
Oct 7, 2013 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,8 +29,9 @@ Creating the change If you want to use git workflow to do code reviews (and are using github), at this point you can create a pull request. Using a pull request, you assign your buddy the task of approving merging your changes (from your feature branch back into master or a release branch). To create the pull request, go to your project on github.com, click "pull requests," then create. Other guy merges in the changes =============================== (assuming no pull request) $ git fetch -
adamloving revised this gist
Oct 2, 2013 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -52,6 +52,8 @@ Other guy merges in the changes (assuming no pull request) $ git branch -d my-feature $ git push origin :my-feature If you used the github pull request workflow, at this point, the reviewer should delete the feature branch. Other useful commands ===================== -
adamloving revised this gist
Oct 2, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,9 +12,9 @@ Creating the change $ git commit -a -m "my feature is this" ... then fetch changes from master since we branched, and re-apply ours on top... $ git fetch $ git rebase master ... Also fine to merge here instead of rebase (but rebasing is better because makes it easier for others!). Resolve conflicts (if any) and add them ... @@ -32,7 +32,7 @@ If you want to use git workflow to do code reviews (and are using github), at th Other guy merges in the changes (assuming no pull request) ========================================================== $ git fetch ... list branches -
adamloving revised this gist
Oct 2, 2013 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,8 +26,11 @@ Creating the change $ git push origin my-feature If you want to use git workflow to do code reviews (and are using github), at this point you can create a pull request. Using a pull request, you assign your buddy the task of approving merging your changes (from your feature branch back into master or a release branch). To create the pull request, go to your project on github.com, click "pull requests," then create. Other guy merges in the changes (assuming no pull request) ========================================================== $ git pull -
adamloving revised this gist
Aug 16, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,9 +15,9 @@ Creating the change ... then pull in changes from master since we branched, and re-apply ours on top... $ git pull $ git rebase master ... Also fine to merge here instead of rebase (but rebasing is better because makes it easier for others!). Resolve conflicts (if any) and add them ... $ git add <filename> $ git rebase --continue -
adamloving revised this gist
Aug 16, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Creating the change $ git commit -a -m "my feature is this" ... then pull in changes from master since we branched, and re-apply ours on top... $ git pull $ git rebase master -
adamloving revised this gist
Aug 16, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Creating the change $ git commit -a -m "my feature is this" ... then pull in changes from master since we branched, and re-apply ours on top. Also fine to merge here instead of rebase (but rebasing is better because makes it easier for others!) ... $ git pull $ git rebase master -
adamloving revised this gist
Aug 7, 2013 . No changes.There are no files selected for viewing
-
adamloving revised this gist
Jun 1, 2013 . 1 changed file with 28 additions and 24 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,54 +1,58 @@ Creating the change =================== $ git checkout -b my-feature ... modify code .... $ git add <filename> $ git commit -m “my feature is this” ... or, if you're lazy ... $ git commit -a -m "my feature is this" ... pulls in changes from master since we branched, then re-apply ours on top. Totally fine to merge here instead of rebase ... $ git pull $ git rebase master ... resolve conflicts (if any) and add them ... $ git add <filename> $ git rebase --continue ... # push my branch back to the server $ git push origin my-feature Other guy merges in the changes =============================== $ git pull ... list branches $ git branch -a ... bring a branch local $ git branch --track my-feature origin/my-feature $ git checkout master $ git merge my-feature ... resolve conflicts and look around ... $ git push ... delete branch (and remote branch) when done $ git branch -d my-feature $ git push origin :my-feature Other useful commands ===================== To remove remote branches from your list after they have been deleted by other people $ git remote prune origin -
adamloving created this gist
Jun 1, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ Creating the change $ git checkout -b my-feature ... modify code .... $ git add <filename> $ git commit -m “my feature is this” ... pulls in changes from master since we branched, then re-apply ours on top. Totally fine to merge here instead of rebase ... $ git pull $ git rebase master ... resolve conflicts (if any) and add them ... $ git add <filename> $ git rebase --continue ... # push my branch back to the server $ git push origin my-feature Other guy merges in the changes $ git pull ... list branches $ git branch -a ... bring a branch local $ git branch --track my-feature origin/my-feature $ git checkout master $ git merge my-feature $ git push ... resolve conflicts and look around ... ... delete branch (and remote branch) when done $ git branch -d my-feature $ git push origin :my-feature Other useful commands To remove remote branches from your list after they have been deleted by other people $ git remote prune origin