This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Creating a submodule: | |
git clone <parent-repo-url> | |
cd path/to/parent/repo | |
git submodule add <repo-url> path/to/submodule | |
Initializing a submodule: | |
git submodule init | |
git submodule update | |
Updating a submodule: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OpenSSL commands | |
To get the server certificates that are used during the HTTPS connection initiation, run the following commands: | |
openssl s_client -showcerts -connect <hostname>:<port> < /dev/null > <outfile.txt> | |
openssl x509 -inform PEM -in <outfile.txt> -text -out <certificatefile.txt> | |
openssl s_client -showcerts -connect www.google.com:443 < /dev/null > outfile | |
openssl x509 -inform PEM -in outfile -text -out cdata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compose a tar file: | |
------------------- | |
tar -cvf file.tar dir1/ | |
tar -zcvf file.tar.gz dir1/ | |
tar -jcvf file.tar.bz2 dir1/ | |
Extract a tar file: | |
------------------- | |
tar -xvf file.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List of pending commits to be pushed from local to remote repo | |
-------------------------------------------------------------- | |
git log origin/master..HEAD | |
git diff origin/master..HEAD | |
git diff origin/feature_branch..HEAD | |
Branch commands: | |
---------------- | |
git branch list all the branches in the local machine | |
git branch -a list all the branches (local + remote) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Go to Bitbucket and create a new repository (its better to have an empty repo) | |
git clone git@bitbucket.org:abc/myforkedrepo.git | |
cd myforkedrepo | |
Now add Github repo as a new remote in Bitbucket called "sync" | |
git remote add sync git@github.com:def/originalrepo.git | |
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync" | |
git remote -v |