Most Used Commands on Git

Initial git repository on current directory
$ git init

Download a project from GitHub/GitLab
$ git clone [url]

Configure your personal information
$ git config --global user.name "Nick Yang"
$ git config --global user.email "your_email@example.com"

Add .gitignore file (generate .gitignore)
$ git config --global core.excludesfile ~/your_file

Add file to area
$ git add [file]

Remove file from Git
$ git rm [file]

Committing Your Changes
$ git commit

Revise last commit
$ git commit --amend

Clear stagging area
$ git checkout -- .

New a branch B from A
$ git checkout -b [B] [A]

Switch to branch A
$ git checkout [A]

Merge branch B to A
$ git merge --no-ff [B]

Tag on current commit
$ git tag [tag_name]

Submmit tag to server side
$ git push [remote] [tag]

Submmit project A
$ git push origin [A]

Delete branch A
$ git branch -d [A]

Store changing, but not commit
$ git stash

List stash
$ git stash list

Applying stash@{2}
$ git stash apply [stash@{2}]

Cancel stash@{2}
$ git stash show -p [stash@{2}] | git apply -R

Remove stash@{2}
$ git stash drop [stash@{2}]

git command tutorial
$ git --help [command]

App Transport Security

Platforms: iOS 9.0 and later, OS X v10.11 and later

Summary:
l   Secure connections between App and back end
l   Https exclusively
l   default strong Internet security in iOS and OS X apps and in app extensions

Protocol: TLS 1.2 and later

Certificates:
l   SHA-2 256 bits
l   ECC 256 bits
l   RSA 2048 bits

Forward secrecy (FS):
l   TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
l   TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
l   TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
l   TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
l   TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
l   TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
l   TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
l   TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
l   TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
l   TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
l   TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA




When the backend server does not follow ATS rules (Eg Using lower level of Transport Layer Securiy, http protocol or self-signed etc. ), it should make a whitelist. It only needs to revise the file of "Info.plist",
Here are some sample settings:


l   Allowing Lowered Security
It can specify protocol, which is lower than TSL v1.2, or which is not supported FS
<key>NSAppTransportSecurity</key>
<dict>
        <key>NSExceptionDomains</key>
        <dict>
                <key>your_server.example.com</key>
                <dict>
                        <key>NSThirdPartyExceptionMinimumTLSVersion</key>
        <string>TLSv1.0</string>
                        <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                        <false/>
                </dict>
        </dict>
</dict>


l   Allowing Http, Self-signed (Insecure connection)
<key>NSAppTransportSecurity</key>
<dict>
        <key>NSExceptionDomains</key>
        <dict>
                <key>your_server.example.com</key>
                <dict>
                        <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
                        <true/>
                </dict>
        </dict>
</dict>



l   Turn off ATS
<key>NSAppTransportSecurity</key>
<dict>
 <key>NSAllowsArbitraryLoads</key>
 <true/>
</dict>


P.S. If the domain which cannot be controlled by the developer, it needs a parameter of  "NSThirdPartyException". I do not know what is different. But it is work for me.

Reference: