Ý kiến Git và Bash aliases từ Alex Pott đang làm ở Chapter Three

Ý kiến Git và Bash aliases từ Alex Pott đang làm ở Chapter Three

Having a good workflow is important. A workflow that is repeatable and consistent makes your life easier.

>> [LimoenGroen]: Continuous Integration & Drupal là gì?

I create a branch for every Drupal core issue that I work on and use the issue’s node id as a branch name. For example:

git checkout -b 2284103

This system has many advantages, especially if you work on multiple patches. It’s also quite easy to implement. If you are reading an issue on Drupal.org, you already have the branch name. From there, it’s as simple as copying and pasting from the url. If you have git shell completioninstalled, you can change your command prompt so that you know which issue you are working on by glancing at the terminal prompt.

The command line is one of the most powerful tools that we have. Learning how to alias commands and join commands together is key since it allows you to automate the process of opening your browser and navigating to the issue at hand. To do this, add the following line to your .bashrc or .bash_profile file:

alias issue="open /Applications/Google\ Chrome.app https://www.drupal.org/node/\$(git symbolic-ref -q HEAD 2>/dev/null | sed 's/^refs\/heads\/\([0-9]*\).*/\1/')"

Why do I use sed and a regular expression? If I am working on multiple versions of the same patch, I add a string to end of the name to differentiate them.

When you are working on the command line and you’ve just prepared a patch for Drupal 8 by doing the following, you can simply type “issue” to open your browser exactly where you want to be.

git diff 8.x HEAD > 2284103.40.patch

If you are repeating the same set of actions frequently, you should use scripts like these to save time.

 The General Problem

Thanks to @xjm for tweaking the alias, regular expression and the blog title.

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Sega Offers Major Holiday Game Sales

Sega Offers Major Holiday Game Sales

It’s the day before Thanksgiving, and most of you are (job-willing) on the verge of a three or four day weekend. You may spend the time embarking on a boring road trip, avoiding family members, or just hanging out at the house enjoying your days off.

Vào Facebook, upload ảnh dễ dàng với VPN miễn phí

Vào Facebook, upload ảnh dễ dàng với VPN miễn phí

Gần đây nhiều người thường than phiền không thể sử dụng đầy đủ các tính năng của mạng xã hội Facebook như đăng ảnh (upload) lên trang,

Giới thiệu về Drush và sử dụng Drush

Giới thiệu về Drush và sử dụng Drush

Với những ai làm việc nhiều với Drupal chắc cũng sẽ chán ngấy với những công việc nhàm chán khi phải cài đặt các phiên bản mới của core hay các module.

Công ty diệt chuột T&C

 

Diet con trung