In this blog I will be going over two ways to use Git without having to use the command line. The command line can be confusing for people who are just learning how to code, and haven't had much experience with working on projects. Through the use of the GitHub website and desktop client I will show you two simple ways to commit changes to a project without having to learn anything about the command line.
What is Git?
Before I start going over how to use Git without the command line I should introduce it to those who don't know what I'm talking about. Git is a tool that allows for people to collaborate on a project remotely, by using its various commands such as,
- Commit
- Fork
- Pull
- Push
- Clone
- Branch
- Tag
These are the most common commands that if you every interact with git, you will be using. The main command that I will be going over today is the commit command.
What is Commit?
Commit is a Git command that marks a point in time for the code, and usually submitted with a message indicating the changes. This is usually done after a push command was submitted to the repository. Commits are comprised of 6 components,
- Who did the changes
- Time stamp of the commit
- Commit message explaining them
- Files changed
- Line added in each file
- Line removed in each file
Now that commits have been explained lets go on with how to interact with repos online.
Commit with GitHub Website
Using commit is very easy with the GitHub Website. Through the website you can edit most document with its basic text editor that is built into the site. I have built a simple repo to help visualize this example. I will be using this repo for the other example as well.
To edit any of the documents all you have to to is click on the file in the menu. For this example I will be editing the README.md file.
Once the file has been clicked on it will bring you to the file details section where you can edit, delete and do just about anything GitHub will allow.
To edit the contents of the file all you have to do is click on the pencil icon next to the open this file on GitHub Desktop button. Once you click on the file it will bring you to the text editor.
From here you'll be able to edit the name and contents of the document. Once you made the changes that you want, scroll down to the bottom of the page, and you will see a section with a commit button and a comment section to document the changes you made.
Commit with GitHub Desktop Application
The GitHub Desktop does not have a text editor. So to edit a file like the README.md file we will need to use an external program. I just used the Windows default notepad program. When you access the repository you'll clone it and make a local folder with the repo in it.
When you open the file in whatever editor you choose, make the changes and save the file. Once the changes have been made The GitHub application will show what file has been changed. It will look like this,
Once you choose the file, on the bottom left you can add a description to the commit. Once you have your desired commit message, hit the commit to main button. That will commit the changes to the project.
And there you have it! Two ways of using Git without the command line. Git is a useful tool for writing code online with a group of people. It allows for easy collaboration between teammates, and makes the online coding process much easier. I hope this has been helpful. Also check out the Youtube video I made on this topic. Have a great day!
Top comments (0)