CommandLine Git and GitHub Basic - AtikRhaman/CommandLine-and-GitHub GitHub Wiki

CommendLine, Git and GitHub

- Command Line basic

- pwd  //Present working directory
- ls  // list to see in the present directory
- ls -l  // everything
- ls .la  // hidden files
- mkdir  // make directory
- touch file-name (i.e.index.html) //create file
- nano file-name (i.e.index.html)  //Open file
- ctrl + x //to save or exit
- cat //for reading the file in terminal
- mv file-name (i.e.index.html) html (folder name) : // move file to folder
- rm file-name (i.e.log.text)  //Remove file
- rm -rf folder-name (i.e htmlFolder)  //Remove folder
- 
- https://brew.sh/ //details about brew
- brew install tree :  //to see the tree view of the directory
- tree //to see the directory tree
- history //to see the history of the comand line
- cp: coppy

- GIT and gitHub

- Introduction to git : https://github.com/Asabeneh/Git-and-Github

- For first time configaration of git:
- git config --global user.name ‘yourname’git config --global user.email ‘youremail’

- git init //this comand for initializa the repository 
- git status // to know the status of the repogit add filename (i.e. index.html) : file/directory add to the staging
- git add . // add everythinggit commit -m "commit name" : to commitgit log : to see the log
- git remote add origin https://github.com/AtikRhaman/git-lesson.git
- git push -u origin master
- git branch  //To see where I am
- git branch branch-name (i.e. branch-test)  //Create new branch
- git checkout branch-name (i.e. branch-test)  //Swith to branch
- git branch -m branch-test test //rename the branch name (m= message)
- git merge branch-name (i.e dev)  //to merge the branch with each other