First 11 Git Bash commands

ppwd –  prints the ‘present working directory’.

mkdir – creates a directory. mkdir -p level1/level2/level3/level4 – create several directories one in another.

cd – changes directory; cd .. – going to the parent folder.

git clone https:// – clones the directory

ls – ‘list’ contents of the current working directory. ls – la – shows hidden folders and files.

git status – shows the default branch and if there are any changes to commit

echo “Test Git Quick Start Demo” >> start.txt – creates new text file with “Test Git Quick Start Demo” content.

cat start.txt – shows the content of the file

git add start.txt – transfers file from the working area to the staging area. git add . – transfers all files to the staging area.

git add -A – adds and updates any changes to the working directory.

git commit -m “Adding start text file” – transfers file from the staging area to repository with message pointed in “.

git commit -am “message” – add all the files to your commit with selected message.

git push origin master – pushes the local copy of the repository to Origin refers to a Github copy of your repository. Master refers to the only default branch in our repository. It is recommended to always do git pull origin master before doing push.

(Visited 29 times, 1 visits today)

Leave a comment

Your email address will not be published. Required fields are marked *