Checkout a single file from a specific commit.
git add .
)
git reset HEAD myFile.txt
The file itself was not changed
git rm --cached -r .
-r --> recursively
Use git status to see result
git checkout -- myFile.txt
git log --oneline --graph --decorate --all
git log --oneline --graph --decorate --all
git diff num1 HEAD
git diff num1 num2
git diff
Diff between what's recently changed in the working directory vs. the HEAD position in the git repository
git diff newFeature master
Compares between branches
Same as diff, but instead of diff use difftool
git difftool num1 HEAD
git config --global --list
# for comments
*.txt
build/
/node_modules
Head points to the last commit of current branch
remote manages a remote connections from the local repositories
git remote
---> shows remote connections
git remote -v
---> shows remote connections with full locations
git remote add origin {url of my remote repository}
origin is a name of the remote repository
u links a local and remote repositories
master is a name of the branch
git push -u origin master
As previous, but also takes tags that exists on local repository
In specific repository on GitHub, go to Insights --> Network and see commits
Duplicate to Computer (Local Repository)
git clone {url.git}
git log - to see commits
git clone {url.git} myFolder
git branch
---> lists all branches, * means that it's current branch
git checkout -b newFeature
Create a new branch and switch to it
...
git push -u origin newFeature
git branch myBranch
git checkout master
git branch - shows the current branch and branches of the repository
git checkout myBranch ---> switch to this branch
git add .
git commit -m "my commit to branch"
git checkout master --> to go back to the master branch
git branch -d myBranch
Near the master dropdown on the main page of the repository click the down indicator
1. git checkout master
--> Go back to the master branch
2. git merge myBranch
--> merge myBranch into master branch
3. Git mergetool
add comment about the merging
git push origin master -u
git fetch
Download contents from a remote repository
git pull
Fetch and download content from a remote repository and immediately update the local repository to match that content
Somebody wants to merge his changes with my repository, so he creates Pull Request for me and I may merge this code into my repository.
Copy (clone) some repository under your GitHub account = to Remote Repository
git tag myTag
git tag --list
shows a list of tags
git tag -d myTag
delete the tag
git tag -a v1.0 -m "Release 1.0"
git show v1.0
git remote show origin
Shows information
--no-verify
GitHub, SmartGit, GitExtensions