![]() Please note: you need to be ON master branch to merge other branches (you can check on which branch you are currently on by typing git branch). Thus, project history is preserved, as the original commit remains intact. This operation results in a new commit that reverses the effect of the commit you want to undo. To merge the branch ( for example: testimonials branch) with the master branch (the main one), type: If you notice an error in a specific commit that has already been pushed, you can revert that commit. To create and at the same time checkout a new branch (in this case named header), type: * instead of the testimonials (name of the branch) you can type master (the main branch): To see which branch you are currently using, type: To push the changes afterwards, simply type: ![]() ![]() To push the files (from your local PC) for the first time to your GitHub repository online, type: Git commit -am "Stage and commit in one command" You can also stage + commit in one command line: To commit new commit + add a message (for example: "Added new message"), type: To add a particular file (for example: index.html) you can type:Īlso you can stage your changes with (here -A is for ALL): It will check for changes and will give you recommendations. Very common and frequently used git command is: To check which is your push repository on GitHub, type: Now, let Git know where to upload your project files online (your push repository). Inside your PHPStorm project's folder you will need to initialize Git (btw you can drag the folder with your project into the terminal). git extension at the end) Instead of AleikovStudio (my username in GitHub - use yours). I prefer to use the terminal built inside the PHPStorm - it is: better, faster and more intuitive.įrom your GitHub copy the repository URL - for example ( note the. Now you will be working with the terminal - you can use Window's cmd or the PHPStorm's terminal. For this example I will be using my real GitHub repository: Then, create an EMPTY repository on GitHub - without readme, ignore and licence files. Download + install it on your PC from HERE:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |