image source https://www.whitelabeldevelopers.tech/Bitbucket
Bitbucket - Git Short Note
git pull (update local tree from the remote tree)
git checkout SSAT-3006-unit-test-add-unit-test-to-su
Check current branch
Git bash
git bash is a git commandline
Git GUI
Stage Ctrl + T
Unstage Ctrl + U
Sign off
Commit (to the local)
Push (to the remote)
Commit and push to Jira branch
git pull origin develop (this step is to synch local branch with remote develop branch)
Resolve any merge conflicts
Stage, sign off, commit and push
Goto Jira item
Click Create pull request
Create a pull request from the current Branch to develop
Assign reviewer
git switch <branch>
git checkout <branch>
Resolve Merge conflict
Goto local working branch git pull origin develop
Master bit bucket best practices
- Create and work on small tasks so chances for impactful merge conflicts are lower.
- Sync up your feature branch frequently.
- Commit to a local end of the work, every day
- git pull develop before start work on every day
- Merge your feature branches as soon as possible. If they’re done, don’t let them hang in there.
- Do not branch too deeply. You will be increasing the time to execute each merge and resolve potential conflicts. Means, avoid a situation like this:
- Structure your branch tree so you minimize the chances of overlapping sibling branches. You should aim to merge along the hierarchy; i.e, merge children into parent instead of 2 sibling branches.
- Be aware that the more work is planned to be parallelized the more chances to have merge conflicts.
- If merge conflicts are unavoidable, plan some time ahead to make sure you address them and their potential side-effects properly.