git config user.name
git config user.email
Then config your git user info.
git config --global user.name "kidwen"
git config --global user.email "[email protected]"
git clone [email protected]:kidwen/git-flow.git
// or
git clone https://github.com/kidwen/git-flow.git
git remote -v
// origin https://github.com/kidwen/git-flow.git (fetch)
// origin https://github.com/kidwen/git-flow.git (push)
git branch -a
git checkout dev
// or
git switch dev
Or create a new branch base on this branch by use params `-b`.
git checkout -b dev
// or
git switch -c dev
# check witch file has been changed
git status
# add all files
git add .
# set this commit message
git commit -m "commit message"
# push code to remote repository
git push -u origin dev
# fetch the latest changes form remote git repository.
git fetch
# integrate changes from one branch into another
git rebase origin/master
# if you have a conflicts, resolve it and use next command
git rebase --continue
# or you want to cancel the rebasing
git rebase --abort
🔄 Then you can push code to the remote.
git switch master
git cherry-pick <commit-hash>
# checkout to that commit by commit id
git checkout < commit id >
# add a tag for current commit.
git tag release-1.0.0
# push the tag to origin repository
git push origin release-1.0.0