Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Configuring Git

  • git config --global user.name "Your Name"
    • Set the user's name for all repositories.
  • git config --global user.email "your.email@example.com"
    • Set the user's email for all repositories.

Basic Operations

  • git init
    • Initialize a new Git repository.
  • git clone <repository-url>
    • Clone an existing repository.

Working with Branches

  • git branch
    • List all branches.
  • git branch <new-branch-name>
    • Create a new branch.
  • git checkout <branch-name>
    • Switch to a branch.
  • git checkout -b <new-branch-name>
    • Create and switch to a new branch.

Making Changes

  • git status
    • Check the status of the working directory.
  • git add <file-or-directory>
    • Stage changes for commit.
  • git add .
    • Stage all changes in the working directory for commit.
  • git commit -m "Your commit message"
    • Commit staged changes.

Viewing History

  • git log
    • Show commit history.
  • git log --oneline
    • Show commit history with one-line summaries.

Pushing and Pulling Changes

  • git push origin <branch-name>
    • Push changes to a remote repository.
  • git pull origin <branch-name>
    • Pull changes from a remote repository.

Merging and Rebasing

  • git merge <branch-name>
    • Merge a branch into your current branch.
  • git rebase <branch-name>
    • Rebase your current branch onto another branch.

Handling Conflicts

  • git add <file-with-conflict>
    • Mark conflicts as resolved.
  • git rebase --continue
    • Continue rebase after resolving conflicts.

Stashing Changes

  • git stash
    • Stash uncommitted changes.
  • git stash apply
    • Apply stashed changes.

Collaborating with Remote Repositories

  • git remote add <remote-name> <repository-url>
    • Add a remote repository.
  • git remote -v
    • List remote repositories.
  • git fetch <remote-name>
    • Fetch changes from a remote repository.
  • git push <remote-name> <branch-name>
    • Push changes to a remote repository.

Viewing Differences

  • git diff
    • Show differences between working directory and the index.
  • git diff --cached
    • Show differences between the index and the last commit.

Tags

  • git tag <tag-name>
    • Create a new tag.
  • git push origin --tags
    • Push tags to the remote repository.

About

git comand for git and github

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages