Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
git-test
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vincent MAZENOD
git-test
Commits
92e6f25d
Commit
92e6f25d
authored
Jul 5, 2021
by
Vincent Mazenod
Browse files
Options
Downloads
Patches
Plain Diff
hard working
parent
d91e0923
Branches
master
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc.md
+44
-0
44 additions, 0 deletions
doc.md
features/git-subtree/fetaure
+2
-1
2 additions, 1 deletion
features/git-subtree/fetaure
with
46 additions
and
1 deletion
doc.md
+
44
−
0
View file @
92e6f25d
https://www.atlassian.com/git/tutorials/git-subtree
## Adding the sub-project as a remote
Adding the subtree as a remote allows us to refer to it in shorter form:
```
git remote add -f git-subtree git@gitlab.isima.fr:vimazeno/git-subtree.git
```
Add the subtree by referring to the remote in short form:
```
git subtree add --prefix features/git-subtree git-subtree master --squash
```
Update git subtree anytime:
```
git fetch git-subtree master
git subtree pull --prefix features/git-subtree git-subtree master --squash
```
## Contributing back upstream
record a merge so that we can track the entire tree history of the plug-in up to this point:
```
git merge -s ours --no-commit git-subtree/main
```
Read the content of the latest tree-object into the plugin repository into our working directory ready to be committed:
```
git read-tree --prefix=features/git-subtree -u git-subtree/main
```
commit on subtree
```
git ci -m"[subtree] adding new feature"
```
update git-subtree repo git pull -s subtree tpope-vim-surround main
\ No newline at end of file
This diff is collapsed.
Click to expand it.
features/git-subtree/fetaure
+
2
−
1
View file @
92e6f25d
a really cool feature
another one
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment