git-flow 라이브러리 사용 테스트
사전 준비 작업
- Create a new repository on GitHub.com.
To avoid errors, do not initialize the new repository with README, license, or gitignore files.
-
on GitHub.com's Quick Setup page, click to copy the remote repository URL.
-
Open Terminal.
-
Change the current working directory to your local project.
create a new repository on the command line
git init
git add README.md
git commit -m "first commit"
# 마스터 브랜치 이름을 main으로 명명
git branch -M main
- Add the URL for the remote repository where your local repository will be pushed.
push an existing repository from the command line
$ git remote add origin <REMOTE_URL>
# Sets the new remote
$ git remote -v
# Verifies the new remote URL
- Push the changes in your local repository to GitHub.com.
# Pushes the changes in your local repository up to the remote repository you specified as the origin
$ git push -u origin main
# To push the current `develop` branch and set the remote as upstream, use
$ git push --set-upstream origin develop
The source
https://github.com/nvie/gitflow
To initialize a new repo with the basic branch structure, use:
사용할 레포의 master/main 이름등을 맞춰줘야 한다.
git flow init
To start feature branches, use:
git flow feature start <name> [<base>]
# Summary of actions:
# - A new branch 'feature/<name>' was created, based on 'develop'
# - You are now on branch 'feature/<name>'
# Without the git-flow
git checkout develop
git checkout -b feature_branch
When you’re done with the development work on the feature, the next step is to merge the feature_branch into develop.
이 명령은 로컬 브랜치를 머지하고 리모트에는 반영되지 않는다. 그리고 PR을 만들 수 없게된다?
git flow feature finish feature_branch
# Without the git-flow
git checkout develop
git merge feature_branch
When done, open a pull request
to your feature branch.
PR 생성은 Github등 웹GUI를 제공하는 플랫폼의 고유 기능?
리모드에 PR을 생성한다. 회사등 공동 작업이라면 feature finish하기 전에 PR부터 만들어야 한다.
git flow feature publish <name>
Summary of actions:
- A new remote branch 'feature/<name>' was created
- The local branch 'feature/<name>' was configured to track the remote branch
- You are now on branch 'feature/<name>'
git flow feature pull <remote> <name>
git flow release start <release> [<base>]
# Summary of actions:
# - A new branch 'release/0.2.0' was created, based on 'develop'
# - You are now on branch 'release/0.2.0'
# Follow-up actions:
# - Bump the version number now!
# - Start committing last-minute fixes in preparing your release
# - When done, run:
# git flow release finish '0.2.0'
# Without the git-flow
git checkout develop
git checkout -b release/0.1.0
git flow release finish <release>
# Without the git-flow
git checkout main
git merge release/0.1.0