Quickly recharge your minds with git commands here !!!!
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
git init
Inside a folder execute to make it as a working repository
git status
To know what is going on in the working directory, what are the changes and what has been staged
git add .
To stage all the changes done in the current working directory like adding files and modifying the existing contents
git add *file name*
To stage the particular file *file name* in which the changes were done
git add *.any extension*
To stage all the particular file types *.any extension* to which changes were done
git add -A
To add all files and folders from the directory that you’re in. This is a good command for adding everything in your project, all at one time
git reset HEAD *file name*
To unstage a particular file which is ready to be committed. will be seen as untracked file
touch .gitignore
Add files and folders to ignore those from staging and committing. These files will not be tracked any more. Keeping the files to only local usage
git commit -m *message*
To commit the staged file or files to the git repository
git log
To get the log of all the commits done
git branch
To list all the branches in a repository
git checkout -b *branch-name*
To create a new branch and will switch to it
git checkout *branch-name*
To switch to an existing branch
git merge *branch-name*
Current branch will merge to an existing branch
git checkout -b *branch-name*
To remove an existing branch
git remote add origin *repository ssh link*
Create a repository in GitHub(explained below) and get the SSH link to add to your local repository
git remote -v
To view the status of the repository connection
git push -u origin master
To push all the committed changes done to the working directory
git pull
To get all the latest commits from the GitHub repository
git remote remove origin
To remove the remote repositories from your local git
Thanks to Ian Schoonover for the guide.
Repositories are used to store folders and files – anything about your project.
Create a new branch to make a copy of your repository in the master branch as working in new branch wont affect the master.
On GitHub, saved changes are called commits.
Thanks to GitHub Guides for the article reference.
Finally, I hope this post was valuable for you so please, please share your feedback and suggestions to help me improve.