Results: 1580
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
Multiple developers can work together on the same project
No need to wait for someone else to make their changes
Git can merge everyone's changes together
Everyone can have the most updated copy of the project's files
by Valeri Tandilashvili
4 years ago
0
Git
Git Tutorial - Learn Command-line Git & GitHub
1
To see what changes each feature takes separately
Not to commit feature changes on the main branch until it's finished
Not to Interfere while other developer is trying to fix an issue on main branch
If I work on two features at the same time, I should be able to commit the finished feature changes immediately
by Valeri Tandilashvili
4 years ago
0
Git
Git Tutorial - Learn Command-line Git & GitHub
1
Remote Repository
Local Repository
Repository
Working directory
Staging
Commit
Message
by Valeri Tandilashvili
4 years ago
0
Git
Git Tutorial - Learn Command-line Git & GitHub
1
Modify files
->
Move to staging area
->
Commit
by Valeri Tandilashvili
4 years ago
0
Git
Git Tutorial - Learn Command-line Git & GitHub
1
git init
Creates an empty git repository to the current folder
git init
Creates a directory
mygit
inside the current folder and an empty git repository into the newly created folder
git init mygit
by Valeri Tandilashvili
4 years ago
0
Git
Git Tutorial - Learn Command-line Git & GitHub
1
The git status lists which files are staged, unstaged, and untracked. Outputs in the short-format
git status -s  /  git status --short
Outputs in an easy-to-parse format for scripts
git status --porcelain
Outputs in the long-format (default)
git status --long
Outputs on one line
git status -z
by Valeri Tandilashvili
4 years ago
0
Git
1
Adds
index.html
to staging area
git add index.html
Adds
any html file
to staging area
git add *.html
Adds several files to staging area
git add index.html another.html index.php
Adds modified and deleted files only
git add -u  /  git add --update
Adds modified and new files only (but not new files without names)
git add *
Adds all the changes - modified, new and deleted files (
-A
is a short handhand notation for
--all
)
git add .  /  git add --all  /  git add -A
Adds all files including files with no names (ignores deleted files)
git add . --no-all  / git add . --ignore-removal
If we want to commit only part of changes of the same file
--patch
or
-p
is used
git add --patch   /   git add -p
Possible answers for the command:
y
stage this hunk for the next commit
n
do not stage this hunk for the next commit
q
quit; do not stage this hunk or any of the remaining hunks
a
stage this hunk and all later hunks in the file
d
do not stage this hunk or any of the later hunks in the file ... The complete list of the possible answers is on the link of the note
by Valeri Tandilashvili
4 years ago
0
Git
Git Tutorial - Learn Command-line Git & GitHub
1
Removes all files from staging area (
git reset
defaults to
HEAD
)
git reset  /  git reset HEAD  /  git reset HEAD .
Removes the specified file from staging
git reset HEAD 1.txt
Deletes all commits after the specified commit but does not change source code (keeps files staged)
git reset --soft i4ol54f
Deletes all commits after the specified commit but does not change source code (keeps files unstaged)
git reset i4ol54f  /  git reset --mixed i4ol54f
Deletes all commits after the specified commit and moves HEAD to that commit (this will get rid of changes so we should be careful)
git reset --hard 004caa3
Deletes the last 3 commits
git reset --hard HEAD~3
git reset
defaults to
--mixed
by Valeri Tandilashvili
4 years ago
0
Git
Git Tutorials
1
touch filename
Creates
a.txt
file
touch a.txt
Creates several files
touch .gitignore a.txt b.txt
does not work on windows
by Valeri Tandilashvili
4 years ago
0
Git
1
echo
Puts some text into
a.txt
file
echo 'some txt' > a.txt
Adds some text at the bottom of the file
a.txt
file (with new line)
echo 'some txt' >> a.txt
The file will be created, if does not exist
also works on windows
by Valeri Tandilashvili
4 years ago
0
Git
1
Results: 1580