Git: Difference between revisions

From David's Wiki
No edit summary
No edit summary
Line 1: Line 1:
Git is the famous version control system made by Linus Torvalds.
Git is the famous version control system made by Linus Torvalds.


=Usage=
==Usage==
==Basic Usage==
===Basic Usage===
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
# Clone or download a repository
# Clone or download a repository
Line 23: Line 23:
</syntaxhighlight>
</syntaxhighlight>


==Branches==
===Branches===




==Pull Requests==
===Pull Requests===


=Git Large File Storage (LFS)=
===Migrating Repositories===
How to migrate repositories to another Git server
<syntaxhighlight lang="bash">
git clone --mirror <original_repo>
cd <repo>
 
# Run the following lines only if you're using lfs
git lfs fetch --all
git lfs push --all <new_repo>
 
git push --all <new_repo>
</syntaxhighlight>
 
==Git Large File Storage (LFS)==
[https://github.com/git-lfs/git-lfs/wiki/Tutorial Reference]
[https://github.com/git-lfs/git-lfs/wiki/Tutorial Reference]

Revision as of 12:03, 8 October 2019

Git is the famous version control system made by Linus Torvalds.

Usage

Basic Usage

# Clone or download a repository
git clone <url>

# Stage your changes
git add <my files>
# Stage all files
git add .

# Make a commit
git commit -m "My commit message"

# Push your changes to the repository
git push

# Pull the latest changes from the repository
# Equivalent to git fetch && git merge FETCH_HEAD
git pull

Branches

Pull Requests

Migrating Repositories

How to migrate repositories to another Git server

git clone --mirror <original_repo>
cd <repo>

# Run the following lines only if you're using lfs
git lfs fetch --all
git lfs push --all <new_repo>

git push --all <new_repo>

Git Large File Storage (LFS)

Reference