Wednesday, November 7, 2018

How to push a code change into Bitbucket remote repository? - Code push into Bitbucket using Git bash


Let us see how to push a code change using Git bash or iTerm on your local machine into bitbucket.

After configuring a freestyle job or pipeline using Jenkins for building and deployment, you would like to make a code change to make sure Jenkins have started automated builds/deployments.

Pre-requistes:
SSH keys set up and uploaded into Bitbucket.

Implementation steps:
1. Go to bitbucket, select repository which you already have setup MyWebApp.
If you already cloned, move to step # 6.
2. Click on clone
3. copy SSH clone url
4. go to git bash window
5. paste the url and enter
git clone git@bitbucket.org:username/repo_name.git
6. cd repo_name

change repo_name per your name of the repo you created in Bitbucket
7. cd MyWebApp/src/main/webapp
8. sudo vi index.jsp

Change Hello world into below yellow highlighted:
<html>
<body>
<h2>Howdy Folks !!! Welcome to DevOps!</h2>
</body>
</html>

9. press escape, enter :wq!
10. git add index.jsp
11. git commit -m "made change to jsp"
12. git push

Now refresh the browser and click on Source to see code changes you made in your git bash window.

6 comments:

  1. This blog is further than my expectations. Nice work guys!!!
    experience design companies

    ReplyDelete
  2. Let us see how to push a code change using Git bash or iTerm on your local machine into bitbucket.
    wrogn arc backpack
    wrogn backpack 45l

    ReplyDelete

  3. Türkiye'nin güzellikleri arasında yer alan kapadokya bölgesinde, tarihi ve doğal zenginlikleriyle dikkat çeken birçok yer bulunuyor. Bu bölgede, hem tarih tutkunları hem de doğa severler için çeşitli aktiviteler mevcut. Gezginler, özellikle https://bayanserik.space/ şehir merkezinden düzenlenen turlar ile bölgeyi keşfetmeye başlıyorlar. Bu sayede, bölgenin benzersiz peri bacalarını ve yer altı şehirlerini yakından görme fırsatı buluyorlar. Her ziyaretçinin unutulmaz anılarla ayrıldığı bu bölge, Türkiye'nin en özel noktalarından biri olmaya devam ediyor.

    ReplyDelete