Ý 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 Tran 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
  • Phone/Zalo: (+84) 944 225 212
  • WhatsApp: (+84) 944 225 212
  • Line Messenger: (+84) 944 225 212
  • Email: [email protected]
  • Telegram Messenger: https:/t.me/tommytran0401

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

 
Book: Front End Drupal, Designing, Theming and Scripting

Download sách Drupal: Theming and Scripting, Designing

Drupal faces a common problem on the Web–the relative lack of new, high quality themes. Front End Drupal tackles this problem directly and is designed to help both experienced designers and rank novices get an understanding of how Drupal theming works. In fact, I’ll be the first to admit I learned a lot from this book.

Bản đồ các quốc gia bị ảnh hưởng bởi botnet Necurs.

Microsoft đánh sập mạng botnet điều hành bởi Evil Corp có trụ sở ở Nga

Microsoft và các đối tác tại 35 quốc gia đánh sập mạng botnet spam và phát tán mã độc Necurs lây nhiễm khoảng chín triệu máy tính toàn cầu.

Chàng trai Việt ở Google

Chàng trai Việt ở Google

“Nhiệt huyết, tài năng vượt trội nhưng vẫn rất khiêm tốn, lễ phép… Việt Anh là đại diện của một thế hệ trẻ mà quốc gia nào cũng mong có được” – giáo sư Stephen Intille  đã không tiếc...

Wordpress Freelancer

 

Wordpress Freelancer