-
Notifications
You must be signed in to change notification settings - Fork 0
/
git-workflow-essentials.qmd
39 lines (29 loc) · 1.21 KB
/
git-workflow-essentials.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Collaboration with git essentials
## Make and track a local version of remote
git checkout -b NAME origin/NAME # E.g. git ch -b docker origin/docker
## Workflows:
### "Start of day" - making a new feature branch
git checkout dev && git pull origin dev
git checkout -b newFeature dev
### "Start of day" - continue working on an existing feature branch
git checkout dev && git pull origin dev
git checkout newFeature && git merge dev
# Doing work in a branch
git add FILE.txt # stage some changes
git commit -m "message about commit" # Commit the changes
# "End of day" procedure (if merging back to dev)
git checkout dev && git pull origin dev
git checkout newFeature && git merge dev
git checkout dev && git merge newFeature
git push origin dev
# "End of day" procedure (if code review needed - pull request)
git checkout dev && git pull origin dev
git checkout newFeature && git merge dev
git push -u origin newFeature
gh pr create --base dev --head newFeature --title "This feature was fixed"
# Delete old feature branch (e.g. after successful merge into dev)
git branch -d newFeature
# Delete remote branch
git push -d origin newFeature
# Update list of available branches (e.g. on a separate system)
git fetch --prune