简体   繁体   中英

How can I set line ending setting for perforce workspace using p4 from command line?

I cannot find documentation of how exactly to set the line ending settings for a workspace using p4 from the command line. I know how to do this from p4v but I need to do it programmatically in a script and so using p4v isn't an option.

I know I can query the current state using the command

p4 client -o

I have found documentation about a setting LineEnd and the different values it can be set to of local, unix, mac, win, and share but I can't figure out or find documentation telling me how to actually issue the command to pass a new value.

Any help would be much appreciated.

The basic idea is you do "p4 client -o" to get the current client spec, modify it, and then pass the modified version to "p4 client -i".

p4 client -o | sed -e "s/LineEnd:.*/LineEnd: unix/" | p4 client -i

Substitute your own value of LineEnd and/or your own sed replacement.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM