Pentester's Promiscuous Notebook
Blog
GitHub
Twitter
Search…
README
Pentest
Authentication Brute Force
Binary Exploitation
C2
Infrastructure
OSINT
Password Brute Force
Perimeter
Shells
Web
Wi-Fi
Red Team
Basics
Cobalt Strike
Infrastructure
Malware Development
SE
Admin
Linux
Networking
Virtualization
Windows
Dev
C / C++
Git
Python
Powered By
GitBook
Git
Add SSH key to the ssh-agent:
1
$ eval "$(ssh-agent -s)"
2
$ ssh-add ~/.ssh/id_rsa
Copied!
Update to latest version:
1
$ sudo add-apt-repository ppa:git-core/ppa -y
2
$ sudo apt update
3
$ sudo apt install git -y
4
$ git version
Copied!
Show global origin config:
1
$ git config --list --show-origin
Copied!
Pull Requests
Syncing a forked repository:
1
# Add remote upstream
2
$ git remote add upstream https://github.com/original/repository.git
3
$ git fetch upstream
4
$ git rebase upstream/master (or git merge upstream/master)
5
​
6
# Update fork from original repo
7
$ git pull upstream master
8
​
9
# Push the updates to fork
10
$ git push -f origin master
Copied!
Working with a repository during a pull request:
1
$ git remote add upstream https://github.com/original/repository.git
2
$ git fetch upstream
3
$ git rebase upstream/master
4
$ git checkout upstream/master
5
$ git checkout -b new-feature
6
...Make changes...
7
$ gc -am "Add a new feature"
8
$ git push -u origin new-feature
Copied!
Signing Git Commits
​
https://www.youtube.com/watch?v=1vVIpIvboSg
​
​
https://www.youtube.com/watch?v=4166ExAnxmo
​
Cache passphrase in gpg agent (dirty):
1
$ cd /tmp && touch aaa && gpg --sign aaa && rm aaa aaa.gpg && cd -
Copied!
Submodules
​
https://tech.serhatteker.com/post/2019-01/changing-git-submodules-urlbranch-to/
​
Edit submodule branch:
1
$ git config --file=.gitmodules -l | grep branch
2
$ git config --file=.gitmodules submodule.Submod.branch development
3
$ git submodule sync
4
$ git submodule update --init --recursive --remote
Copied!
Dev - Previous
C / C++
Next - Dev
Python
Last modified
1mo ago
Copy link
Contents
Pull Requests
Signing Git Commits
Submodules