We will simply reference commit as :
git commitgit addgit rmCopy from :
# add remote
git remote add remote_name your_url
git remote add origin git@git.extrainteger.com:exi/open-project.git
git remote add mainrepo git@git.extrainteger.com:exi/open-project.git
# remove remote
git remote remove remote_name
git remote remove mainrepo
# update
git remote update
# fetch
git fetch remote_nameCommand :
git push remote_name current_branchCommand :
git pull remote_name current_branchCommand :
git merge another_branch_nameCommand :
# rebase with local branch
git rebase branch_name
# rebase with remote branch
git rebase remote_name/branch_nameCommand :
Good practice if you work alone or in a very small team
Single workflow :
Team workflow :
git commit -m "update readme"git add .git push origin masterGood practice if you work in a small team. All members are equal.
workflow :
git checkout -b add-readme-pagegit add .git commit -m "update readme"git checkout mastergit merge add-readme-pagegit pull origin master
git push origin masterGood practice if you work in :
A master is the one that maintain main branch (protected)
Developers commits in their branch and makes PR
workflow :
git checkout -b add-readme-pagegit add .git commit -m "add readme page"git checkout mastergit pull origin mastergit checkout add-readme-pagegit rebase mastergit push origin mastergit checkout mastergit pull origin masterGood practice if you work in :
Similiar with flow 3 but using main branch and forked branch
workflow :
* one time only