User Tools

Site Tools


git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
git [2026/03/01 20:21] reddygit [2026/05/02 20:13] (current) reddy
Line 1: Line 1:
 +
 +==== Git Remote Server ====
 +
 Setting up a git server is as easy as this... Setting up a git server is as easy as this...
  
Line 23: Line 26:
 </code> </code>
  
 +==== Merge between branches ====
  
 <code> <code>
Line 41: Line 45:
 git push --set-upstream origin someBranch git push --set-upstream origin someBranch
 </code> </code>
 +
 +==== Sub Module ====
 +
 +A sub module creates a link to another Git repository.
 +
 +<code>
 +# Allow the use of file paths
 +git config --global protocol.file.allow always
 +
 +# Add the other repo as a submodule
 +git submodule add /Users/nitin/Documents/practice/try_git_child_1 child_1
 +
 +# Subsequently, fetch the changes from the submodule
 +git submodule update --remote
 +
 +# When someone wants to clone the parent repo
 +git -c protocol.file.allow=always clone --recurse-submodules /Volumes/path/to/repository
 +</code>
 +
 +==== Sub Tree ====
 +
 +A subtree is essentially a copy. The parent repository does not have any reference to the path of the child repository (therefore all the "git subtree" commands require the path to the child repository).
 +
 +<code>
 +# Add/Push/Pull
 +git subtree add/pull/push --prefix child_1 /Users/nitin/Documents/practice/try_git_child_1 main
 +</code>
 +
 +==== Git Checkout Subdirectory ====
 +
 +<code>
 +git clone --no-checkout --depth=1 --filter=tree:0 https://github.com/pockettheories/somerepo.git
 +cd test-git-partial-clone-big-small-no-bigtree
 +git sparse-checkout set --no-cone /subdir1 /subdir2 /subdir3
 +git checkout
 +</code>
 +
git.1772392912.txt.gz · Last modified: by reddy

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki