Portfast is used to immediately start sending frames by skipping the blocking, listening and learning steps of STP. It should normally be used on access (end-device) interfaces.
For access interfaces, portfast is normally used with bpduguard to shut down the interface if another switch is connected to the access interface in order to prevent STP loops that can create broadcast storms that will kill the network.
You can globally enable portfast and bpduguard. This will only affect access interfaces, not trunks (you normally do not want it on trunk interfaces to other switches), unless you add the trunk keyword. You can do this with the global commands:
spanning-tree portfast default
spanning-tree portfast bpduguard default
That relieves you from having to enable and disable the commands on the interfaces as you change interfaces between trunk and access interfaces.