2. Git :
• Git is a version control system
• VCS are Tools that helps to manage changes in the source
code over time
• Types of VCS: centralized ,distributed
• Git is a distributed VCS.
6. Git task Notes Git commands
Tell Git who you are
Configure the author name
and email address to be used
with your commits.Note that
Git strips some characters (for
example trailing periods) from
user.name.
git config --global user.name
"Sam Smith"
git config --global user.email
sam@example.com
Create a new local
repository
git init
Check out a repository
Create a working copy of a
local repository:
git clone /path/to/repository
For a remote server, use:
git clone
username@host:/path/to/rep
ository
Add files
Add one or more files to
staging (index):
git add git add *
Commit
Commit changes to head (but
not yet to the remote
repository):
git commit -m "Commit
message"
Commit any files you've added
with git add, and also commit
any files you've changed since
then:
git commit -a
7. Push
Send changes to the master
branch of your remote
repository:
git push origin master
Status
List the files you've changed
and those you still need to
add or commit:
git status
Connect to a remote
repository
If you haven't connected
your local repository to a
remote server, add the
server to be able to push to
it:
git remote add origin
List all currently configured
remote repositories:
git remote -v
Branches
Create a new branch and
switch to it:
git checkout -b
Switch from one branch to
another:
git checkout
List all the branches in your
repo, and also tell you what
branch you're currently in:
git branch
Delete the feature branch: git branch -d
Push the branch to your
remote repository, so others
can use it:
git push origin
Push all branches to your
remote repository:
git push --all origin
Delete a branch on your
remote repository:
git push origin :
8. Update from the remote
repository
Fetch and merge changes on the
remote server to your working
directory:
git pull
To merge a different branch into
your active branch:
git merge
View all the merge conflicts:View
the conflicts against the base
file:Preview changes, before
merging:
git diff
git diff --base
git diff
After you have manually resolved
any conflicts, you mark the changed
file:
git add
Tags
You can use tagging to mark a
significant changeset, such as a
release:
git tag 1.0.0
CommitId is the leading characters
of the changeset ID, up to 10, but
must be unique. Get the ID using:
git log
Push all tags to remote repository: git push --tags origin
9. o local changes
If you mess up, you can replace the
changes in your working tree with the
last content in head:Changes already
added to the index, as well as new
files, will be kept.
git checkout --
Instead, to drop all your local changes
and commits, fetch the latest history
from the server and point your local
master branch at it, do this:
git fetch origin
git reset --hard origin/master
Search
Search the working directory for
foo():
git grep "foo()"
10.
11. Bitbucket And Jira:
• Login to bitbucket using an Atlassian account (cloud)
• Add VCS Account through Jira application links(optional).
• Once linked you can go back to bitbucket and create a new
repository.
• Jira issue can be linked by including issue key in the commit
message.
12.
13. • Select your workspace
• Enter project name (a good practice is to
have a bitbucket project for each jira
project)
• Enter repository name
• Select access levels
• Create the repositry
14. To clone a repository , got to source
And press on clone
Copy the git command and paste I in a command line.
If you are prompted to login enter your credentials.
15. Menu Overview:
• Source: containing all the files and source codes
• Commits: a list of all commits with details
• Branches: a list of all branches with the ability to create
a new branch through the bitbucket UI.
• Pull requests: a list of pull requests to merge branches to the master branch
• Pipelines and deployments: used by the dev team to setup continuous
Integration And deployment (Bamboo is used for this purpose on server).
• Jira issues : a list of linked Jira issues.
• Downloads : to download the repository
• Repository settings
17. Jira and bitbucket:
• Once linked with bitbucket, and new development section will appear on the Jira ticket.
• A new branch corresponding to the issue can be created
• All the details concerning this issue will be displayed in
the development section (pull requests,builds…)
• Also , on the workflow transitions , triggers can be added
to transition issue automatically based on a bitbucket event
such as : pull request created,pull request denied ,commit created…
18.
19. • Bamboo is a tool from Atlassian suite.
• It is used for continuous integration, deployment, and delivery.
• Bamboo is java based.
• Platform independent (is compatible with different programing
languages)
20.
21. How to install Bamboo:
• As Bamboo is java based , it runs with JDK (not JRE).
• make sure that JDK is installed and the JAVA_HOME variable is
set correctly.
• Download JDK: https://www.oracle.com/java/technologies/javase-
downloads.html
• Set JAVA_HOME: https://confluence.atlassian.com/doc/setting-
the-java_home-variable-in-windows-8895.html
22. How to install Bamboo:
1. Download Bamboo
Download Bamboo from the Atlassian download site. You can choose either the Windows
Installer versions (.exe) or the ZIP Archive (.zip).
2. Start Bamboo
a) In the command line, change the directory to <Bamboo installation directory> and run
the command to start Bamboo:
$ cd <Bamboo installation directory>
$ binstart-bamboo.bat
b) After successfully starting Bamboo, you will find it online at http://localhost:8085/
3. Configure Bamboo
You are starting Bamboo for the first time, so you will need to follow the Setup Wizard to
configure Bamboo. See Running the Setup Wizard.
23. Linking bamboo with other apps:
• Bamboo can be linked to jira using the application links
https://confluence.atlassian.com/bamboo/linking-to-another-
application-360677713.html
• Bamboo is linked to bitbucket through application links
also(server)
• Note that bamboo is only available as a server version
24. Automatically linking issues to a build
• Bamboo will automatically link an issue to a build if you
specify a Jira issue key in a Bamboo build comment or label,
or in a code commit message.
• The issue key must be of the default Jira issue key format.
25. Manually linking issues to a build
1. Go to the plan in Bamboo.
2. Click on the build number for a build result.
3. Click the Issues tab in the 'Build Result Summary'. All of the Jira
issues linked to your build will be listed.
4. Click Add linked issue.
5. Enter the Jira issue key of the issue you want to link to this build.
Please note, the issue key must be of the default Jira issue key
format.
6. Click Save.
26.
27.
28.
29.
30. Getting started with Bamboo
https://www.youtube.com/playlist?list=PLaD4FvsFdarQp-
qHSr3EqWz1WLFa-HUeD
31. Using Bamboo:
• Go to Localhost:8085
• Put in the license
• Two installation options are vailable:
1. Express (integrated db)
2. And custom (custom database postgres,sql…)
32.
33. Create a new plan:
• Click create new plan
• Fill in the data in the popup window (choose repository and host)
• In the authentication part, use the Atlassian username used to
login to bitbucket
• For the password go to bitbucket ,click on your profile ,then app
passwords and generate a new password and use it.
• Then for the authentication type use the username and password
or ssh key pairs. (ssh-keygen -m PEM -t rsa)
https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-
key/
38. Create Tasks:
• Task can be chosen from a set of built-in bundles, such as
maven builder for java projects…
• Or custom scripts can be added to run as a task.
• Also, repository tasks such as creating a new branch can be
done too.
39. Plan actions:
• Disable plan
• Add or modify plan label (can include a jira issue key)
• Delete plan
• Run (run the plan with all jobs and tasks)