Git: Difference between revisions

From David's Wiki
No edit summary
Line 9: Line 9:
# Stage your changes
# Stage your changes
git add <my files>
git add <my files>
# Stage all files
# Or stage all files
git add .
# git add .


# Make a commit
# Make a commit

Revision as of 12:05, 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>
# Or 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