Ý 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

 
Cách thiết lập chiều rộng tối thiểu và tối đa các tab trong Firefox

Cách thiết lập chiều rộng tối thiểu và tối đa các tab trong Firefox

Nếu bạn thường xuyên mở rất nhiều tab trong Firefox, đôi khi bạn sẽ không thể nhìn thấy tất cả các tab đã mở do chúng quá nhỏ, và cách duy nhất để di chuyển giữa các tab là sử dụng các mũi tên di chuyển tab.

Thị trường nhân dụng qua Internet

Thị trường nhân dụng qua Internet

Thế kỷ 21 là kỷ nguyên của sự bùng nổ thông tin, và đi theo với sự phát triển của mạng Internet đã có không biết bao nhiêu dịch vụ và các cơ hội kinh doanh cho những ai biết sử dụng nó và có sáng kiến trong lãnh vực của mình.

Người mua thiếu niềm tin: thị trường BĐS còn bi đát

Người mua thiếu niềm tin: thị trường BĐS còn bi đát

Không như kỳ vọng của các DN BĐS về thị trường sẽ ấm trở lại từ quý II/2012, diễn biến và kết quả thực tế của thị trường trong nửa đầu năm hiện lên với nhiều giảm sút mà vẫn chưa thấy đà bật lên.

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

 

Diet con trung