The Artima Developer Community
Sponsored Link

Java Buzz Forum
Pull request proficiency: Fetching abilities unlocked!

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Mathias Bogaert

Posts: 618
Nickname: pathos
Registered: Aug, 2003

Mathias Bogaert is a senior software architect at Intrasoft mainly doing projects for the EC.
Pull request proficiency: Fetching abilities unlocked! Posted: Aug 12, 2014 10:56 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Mathias Bogaert.
Original Post: Pull request proficiency: Fetching abilities unlocked!
Feed Title: Scuttlebutt
Feed URL: http://feeds.feedburner.com/AtlassianDeveloperBlog
Feed Description: tech gossip by mathias
Latest Java Buzz Posts
Latest Java Buzz Posts by Mathias Bogaert
Latest Posts From Scuttlebutt

Advertisement

Nowadays applying a fix to a project is as easy as creating a fork – which conjures up a full remote copy of the project for you to hack on – selecting the file you want to change, pressing Edit and committing your fixes. What if you are at the receiving end of a pull request (abbreviated PR in the following) instead? Using a polished web UI is great and often that’s all you need. Click a button to Approve, click a button to Merge and you’re done. But that’s not always the case! It’s a common occurrence to have to download the changes included in a pull request(PR) locally, run a few tests, see how they look in your IDE to make sense of what was done. The steps to download – more explicitly fetch and checkout – your colleague’s or contributor’s pull requests are conceptually simple but they become even easier if you know a couple of important details and tips. So let me guide you to a better understanding of the command line facilities git gives you to handle pull requests from the command line with ease. Before we start: enrich your shell prompt with branch name and status I am always surprised by how many people have a bare command prompt that doesn’t show the git branch they are on or whether they have modified/uncommitted files in their working directory. If you thought – Hey that’s me! – allow me to help you and blow your mind at the same time! Please do yourself a favor and install something like the awesome liquid prompt which will give you excellent annotations on the status of your git working directory (and will support any other VCS, too): (In the above screenshot you see my prompt alerting me that I am on branch newbranch and have added 5 lines to the files I track in my working directory and I have removed 0) Everyone working in the same repository If you work on the same repository with your team the process of checking out a pull request is very straight forward: just fetch and checkout the branch from which the pull request was created: Get all the branches that were published on your shared repository: 1git fetch origin Create a local branch that tracks the remote branch you’re interested in: 1git checkout -b PRJ-1234 origin/PRJ-1234 Now you can diff, merge, test your heart out of this: 123git diff master ./run-tests.sh When you’re happy just go back to the Web UI and provide feedback or Approve the change outright. Contributors working in their own forks The process changes a bit when some of the contributors work in separate forks. In this case you can fetch the remote branch where the contribution or feature was committed: Add the contributor’s remote first: 1git remote add jsmith http://bitbucket.org/jsmith/coolproject.git Collect all the latest updates from origin first, your main repository: 123git checkout master git fetch origin git merge master Get all the branches that […]

The post Pull request proficiency: Fetching abilities unlocked! appeared first on Atlassian Blogs.

Read: Pull request proficiency: Fetching abilities unlocked!

Topic: Introducing Hadoop Development Tools Previous Topic   Next Topic Topic: JUnit Assertions Example

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use