Git
The commands and tips using in git.
Main documentations on website
https://git-scm.com/docs
Install Git on LinuxQuick start
Clone, add, commit and push (GitHub)
$ cd projects #your path
$ pwd
# 1. Clone project from GitHub
$ git clone https://github.com/testerBartek/GIT
$ cd GIT
$ git status
# 2. Create test.txt with wrote Test Git
$ echo "Test Git" >> test.txt
$ ls
$ cat test.txt
$ git status
# 3. Add, Commit with message
$ git add test.txt
$ git status
$ git commit -m "Add a test.txt file"
$ git status
# 4. Push to remote Repo (GitHub)
$ git push origin masterInit (Fresh Project), use alias notepad++, remove
Unzip and mv of dir, remote GitHub
The basic commands
Setup and Config
git
git config
Getting and Creating Projects
git init
git clone
Copy will be create in our current path ($ pwd)
Basic Snapshotting

git add
git status
git restore
git reset
git commit
git rm
git mv
Branching and Merging
git log
Patching
git revert

Sharing and Updating Projects
git pull
Check for modifications and copy it from remote Repository.
git push
git remote
Add existing local repository to GitHub remote repository.
Guides
gitignore
Plumbing Commands
git ls-files
Git programs integrations
Environment variable
Copy path of file .exe of your program
Open Advanced system settings
Advanced
Environment Variables
Find Path in system variables and Click Edit...
Add new path like (C:\Program Files\Notepad++)

Adding alias
Alias to git bash
Path to Your user like $ pwd /c/Users/nn
Use command $ notepad++ .bash_profile
3. In new line just type an alias like You want. For example to open "notepad++" don't type whole name just type or "npp".
4. Save and close notepad++. Close and open again git bash. 5. Now after type $ npp should open notepad++
Alias to .git projects
alias to git log --all --graph --decorate --oneline"
Notepad++
Add notepad++ to environment variable
After that notepad++ could be run from git bash
3. You could add alias to create shortcut to open notepad++ like in Adding alias Heading.
4. Add notepad++ to global core editor
5. Check is it correct (if open in notepad++ it is correctly)
Last updated
Was this helpful?