-
Notifications
You must be signed in to change notification settings - Fork 3
Git
Checkout remote branch:
git checkout -b <name> origin/<name>
Checkout directory to given changeset:
git checkout 3257289075289037592abcde253 -- path/to/the/folder/
Multiple working trees sharing one repository:
git worktree add ../some/path/ branch
Checkouts branch
under ../some/path/
Compare file with branch:
git diff mybranch otherbranch -- somefile
Transfer single commit between branches:
git checkout desired_branch
git cherry-pick commit_to_be_transferred_here_by_hash
git checkout orig_branch
#rollback commit
git reset --hard HEAD^
Remote to local:
git checkout -b <local_branch_name> <remote_name>/<remote_branch_name>
Remote:
git push <remote_name> --delete <branch_name>
Locally:
git branch -d <local_branch_name>
First rename locally, then delete old branch on remote, finally push "new"
git branch -m old_branch new_branch
git push origin :old_branch
git push --set-upstream origin new_branch
Project can depend on other projects. Root project is called superproject.
Submodule is always a commit in other repostiory. In other words: submodule points to particular commit.
git submodule add https://repo.url... [path]
add submodule to project at path.
If no path is given then repo name is used.
git submodule deinit <submodule>
git rm <submodule>
rm -rf .git/modules/asubmodule
By default submodules are not cloned. In order to clone repository that contains submodules:
git clone <repo url>
git submodule init
git submodule update
In order to "upgrade" the submodule (actually submodule's commit):
cd submodule_dir
git checkout desired_branch
git pull
cd ..
git add submodule_dir && git commit -m "..."
In order to change submodule's URL, edit .gitmodules files and run git submodule sync
- General
- OS
- Networks
- Configuration
- Protocols
- Link layer
- Sockets
- Routing
- Tunneling
- Debugging
- LoRa
- Virtualization
- Infrastructure as a code
- Desktop environments
- Monitoring
- Benchmarking