Skip to content

azrilpramudia/learn-github-full-course

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Git & GitHub Full Course

Front Images

Don't Forget to ⭐ Star This Repository!


📄 Git Cheatsheet

Cheatsheet


💻 Git Commands Guide

1. git init

  • Function: Initializes a Git repository in the local directory.
  • Example: git init
  • Explanation: Creates a new Git repository in the current directory.

2. git clone

  • Function: Downloads a repository from a remote source.
  • Example: git clone https://github.com/username/repo.git
  • Explanation: Copies a repository from remote to local.

3. git add

  • Function: Adds changes to the staging area.
  • Example: git add . or git add <file>
  • Explanation: Prepares files to be committed.

4. git commit -m "<message>"

  • Function: Saves a snapshot of the staging area.
  • Example: git commit -m "Initial commit"
  • Explanation: Commits the changes with a descriptive message.

5. git status

  • Function: Displays the status of files in the repository.
  • Example: git status
  • Explanation: Shows modified, staged, or untracked files.

6. git push

  • Function: Sends commits to the remote repository.
  • Example: git push origin main
  • Explanation: Synchronizes the local branch with the remote.

7. git pull

  • Function: Fetches and merges changes from remote.
  • Example: git pull origin main
  • Explanation: Updates the local branch from the remote.

8. git branch

  • Function: Lists or creates branches.
  • Example: git branch or git branch new-feature
  • Explanation: Manages development branches.

9. git checkout

  • Function: Switches between branches or specific commits.
  • Example: git checkout main or git checkout <commit>
  • Explanation: Navigates between branches or repository states.

10. git merge

  • Function: Merges another branch into the current branch.
  • Example: git merge new-feature
  • Explanation: Integrates changes from a different branch.

11. git log

  • Function: Views commit history.
  • Example: git log
  • Explanation: Displays a list of all commits.

12. git revert <commit>

  • Function: Reverses the changes of a specific commit.
  • Example: git revert <hash_commit>
  • Explanation: Creates a new commit that undoes the specified commit.

13. git reset

  • Function: Resets the repository to a previous commit.
  • Example: git reset --hard <commit>
  • Explanation: Moves the branch pointer to a previous commit (can discard changes).

14. git stash

  • Function: Temporarily stores working directory changes.
  • Example: git stash
  • Explanation: Saves uncommitted changes to be reapplied later with git stash pop.

📚 Learn More

SuperSimpleDev

SuperSimpleDev

JavaScript Mastery

JavaScript Mastery


🙌 Credits

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages