I want to do a script that help me to release a system by checkout a repo in GIT.

My quest is can I some way test to checkout a branch to identify if I got error without to rely do this on the file-system.

As same, can I on a easy way preview a GIT merge for identify conflict without modify the file-system?

(The full system is run on Linux system if this is to help)