Summary
- First I’ve learned whats the difference between GUI VS CLI.
GUI (Graphical User Interface): The way we interact with the system using graphics (The normal windows screens).
CLI (Command Line Interface): The way we interact with the system using command lines (The black screen terminal).
here are some commands in CLI :
- Mkdir (make directory): to create a folder.
- Cd: change directory.
- Ls: list files, folders.
- Touch : create a file and put the extension at the end.
- Cd .. : go back.
- Pwd (print current working directory): show me where I’m (path).
- Cd~ : go to home directory.
In order to collaborate on Git projects, you must interact with remote repositories, versions of a project residing online or on a network. You can work with multiple repositories, for which you can have read/write or read-only privileges. Teams can use remote repositories to push information to and pull data from.
GIT
GIT : version control system, it’s on our local machine, we can see our files, what changes are made, why they are made and by who, the most popular commands using Git are add-commit-push which developers refer to them as ACP.
here are some GIT commands :
- git clone (the link of my repo) : to have my repo downloaded on my local machine, I do this one time.
- git add . (with space) : when I do some changes on my file I use git add . or instead of . I can add the file name itself, but we use . as a shortcut to stage the changes in all files and folders in my repo.
- git commit -m ‘the message you want’ (the msg should be between ‘ ‘ or “ “) : to commit my changes.
- git push origin main : in order to have my changes on GitHub (on the cloud) I use git push origin main, You will be asked to provide your username and password of your GitHub account (when writing the password you will not see anything) When I go back to GitHub, I refresh the page and I will see my changes that I added on my files and I can also see my commit messages.
- git status: will give us an explanation about what’s happening, the state of our repo, we can see the changes that we did and to see the tracked and untracked files.
Note: You can only successfully push changes upstream if you have write access for the server from which you cloned, and if someone else has not pushed changes upstream that you haven’t pulled yet. If a collaborator pushed changes upstream after you had cloned, your push will not be successful. You will have to pull new changes and merge them with your branch before you can successfully push your changes upstream.