15 Most Common github commands Flashcards

1
Q

git add [file]:

A

Meaning: Adds changes in the file to the staging area.
Example: git add README.md

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

git branch [branch-name]:

A

Meaning: Creates a new branch.
Example: git branch feature-x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

git checkout [branch-name]:

A

Meaning: Switches to a different branch.
Example: git checkout feature-x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

git clone [repository]:

A

Meaning: Copies a repository from remote to local.
Example: git clone https://github.com/user/repo.git

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

git commit -m “[message]”:

A

Meaning: Commits the changes and adds a message describing what was done.
Example: git commit -m “Updated README”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

git init:

A

Meaning: Initializes a new Git repository.
Example: git init

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

git log:

A

Meaning: Shows the commit history.
Example: git log

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

git merge [branch-name]:

A

Meaning: Merges changes from one branch to another.
Example: git merge feature-x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

git pull:

A

Meaning: Pulls updates from a remote repository.
Example: git pull origin master

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

git push:

A

Meaning: Pushes your committed changes to a remote repository.
Example: git push origin master

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

git remote add [alias] [url]:

A

Meaning: Adds a new remote repository.
Example: git remote add origin https://github.com/user/repo.git

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

git revert [commit-hash]:

A

Meaning: Undoes changes from a particular commit.
Example: git revert abc123

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

git stash pop:

A

Meaning: Restores the changes you’ve stashed away.
Example: git stash pop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

git stash:

A

Meaning: Temporarily stores changes that you haven’t committed yet.
Example: git stash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

git status:

A

Meaning: Checks the status of your changes.
Example: git status

How well did you know this?
1
Not at all
2
3
4
5
Perfectly