Competitive programmer and web developer. Owner at codesnipeet.com
To playing with git you have to do the following things step by step
First of all, guys, you have to know the term Git and gitHub. Then we will learn all the basic commands and how it works.So read the introduction part,
Set email: git config --global user.email "[email protected]"
Set username: git config --global user.name "Your Name"
To use the git tool for uploading your project in the GitHub repository, you must configure the git tool with your
. It confirms that the git is installed on your PC. Today I am going to show step by step how can you configure your git tool easily. So, let’s get started.
Then go to the project folder and open the git tool by right-clicking the empty window and select Git Bash Here link.
Note that obviously you have installed git tool in your PC.
git add .
git commit -m”my first commit”
Finally, go to the newly created git repository in GitHub and copy the following two lines from your repository.
Done you have succeeded the first time uploading your project to GitHub.
git clone <clone_url>
Example: git clone https://github.com/jewelcse/login-registeration-in-php.git
git checkout -b <new_branch_name>
It creates a new branch in your git repository by using your given name.
After creating a new branch it automatically switches your current branch to the new branch.
git checkout <existing_branch_name>
This command switches the user to the current branch to another branch.
git add .
git commit -m"commit_messages"
It works when you are in your master branch.
But when you work as in another branch then the command will be
git push origin <your_branch_name>
To learn more about visit: https://www.codesnipeet.com
Create your free account to unlock your custom reading experience.