In nvim, I use plugin fugitive
open two vertical buffer (one form target, another from feature)
1 | :Gvdiffsplit! |
stay on middle and use
1 | :diffget [buffername](local) |
OR
go to target/feature buffer and use
1 | :diffput [buffername](target/feature) |
save the local file and use
1 | :Git add . |
1 | git remote add origin git@github.com:... |
origin
is the name of the repository
Check remote repository settings:
1 | git remote -v |
Before push to remote repository, make sure the branch name is the same.
find all the branch
1 | git branch -a |
find all the branch on remote repository
1 | git remote -r |
Rename
1 | git branch -m oldBranchName newBranchName |
Move to branch:
1 | git checkout [branchname/SHA-1] |
A Git submodule allows a user to include a Git repository as a subdirectory of another Git repository. This can be useful when a project needs to include and use another project. For example, it may be a third-party library or a library developed independently for use in multiple parent projects. With submodules, these libraries can be managed as independent projects while being used in the user’s project. This allows for better organization and management of the code.
To add an existing Git repository as a submodule to a project, the git submodule add
command can be used. The command format is git submodule add <url> <path>
, where <url>
is the URL of the submodule repository and <path>
is the storage path of the submodule in the project. For example, if a user wants to add the remote repository https://github.com/username/repo.git
as a submodule to their project and store it in the my-submodule
directory, they can use the following command:
1 | git submodule add https://github.com/username/repo.git my-submodule |
This will successfully add a submodule named my-submodule
to the user’s project.