git clone <repo-https-url>
git clone <repo-url> --branch <branch-name> --single-branch
git status
git add <filename1> <filename2> <filename3>
git add .
git commit -m “<explain your commit>”
git push origin <branch_name>
git pull origin <branch_name>
git fetch
git branch <branch_name>
git checkout -b <branch_name>
git checkout <new_branch_name>
git reset --hard <commit-number>
git clean -f -d
git rm -r --cached . git add . git commit -m ".gitignore updated"
git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d
git add -u
git reset HEAD~1
git config --global user.name "anshulriyal00@gmail.com"
git config --global user.email "anshulriyal00@gmail.com"
Git remote -v
OUTPUT:
origin https://github.com/AnshulRiyal/developer_baby.git (fetch)
origin https://github.com/AnshulRiyal/developer_baby.git (push)
git remote set-url origin https://github.com/AnshulRiyal/developer_babySteps.git
OUTPUT:
origin https://github.com/AnshulRiyal/developer_babySteps.git (fetch)
origin https://github.com/AnshulRiyal/developer_babySteps.git (push)
git remote remove <name>
=> Where name
is origin
in above output.
Open a terminal and navigate to the directory of your project, i.e. - cd path_to_your_project.
Run this command:
rm -rf .git*
ls -al
pwd
mkdir directory
rm file
rm -r directory
rm -f file
rm -rf directory
cp file1 file2
Copy source_directory recursively to destination. If destination exists, copy source_directory into destination, otherwise create destination with the contents of source_directory.
cp -r source_directory destination
mv file1 file2
ln -s /path/to/file linkname
cat file