Getting started Flashcards

1
Q

Create git repository

A

Go to folder and then

git init

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

Check for changes etc

A

git status

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

Add a file

Commit a change

A

git add . \ all changes
git add “file_name.txt”
git commit -m “Message here”

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

View commit log

A

git log

use git help log for all the ways to view the log

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

Check differences working directory

A

git diff

git diff file name

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

Check differences staging directory

A

git diff –staged

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

Undo a git add

A

git reset

git reset filename

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

remove a file from staging

A

git rm filename

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

move/rename a file

A

git mv filename newname
this will also move it if you adda path
git mv filename path/newname

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