In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "how to use Git to create an executable script on Windows". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
To make a long story short, today I'll show you how to create an executable shell script on windows using Git.
First of all, we need to know that the file permissions added by Git on windows by default are:-rw-r--r-- (the corresponding permission value is 644), and usually the shell scripts created want to be executable naturally, so it is necessary to use Git on Windows to manage shell scripts to ensure executable permissions.
Early posture (one Git Commit):
C:\ Temp\ TestRepo > touch foo.sh
C:\ Temp\ TestRepo > git add foo.sh
C:\ Temp\ TestRepo > git ls-files-- stage
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 foo.sh
C:\ Temp\ TestRepo > git update-index-- chmod=+x foo.sh
C:\ Temp\ TestRepo > git commit-m "Executable!"
[master (root-commit) 1f7a57a] Executable!
1 file changed, 0 insertions (+), 0 deletions (-)
Create mode 100755 foo.sh
The file permission bit changed from-rw-r--r-- (644) to-rwxr-xr-x (755 executable).
We are overwriting the executable bits of the file in the index area.
The latest pose, starting with Git 2.9, allows you to temporarily save files and set executable bits in the add command:
Git add-- this is the end of chmod=+x path/to/file 's "how to create an executable script on Windows using Git". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.