0% found this document useful (0 votes)
11 views

Git Hub Crash Course

This document provides a comprehensive guide on configuring Git settings, including setting global user name and email, creating repositories, and managing version control commands. It covers essential Git operations such as adding, committing, branching, merging, and pushing changes to remote repositories. Additionally, it includes commands for viewing commit history and managing files within a Git project.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Git Hub Crash Course

This document provides a comprehensive guide on configuring Git settings, including setting global user name and email, creating repositories, and managing version control commands. It covers essential Git operations such as adding, committing, branching, merging, and pushing changes to remote repositories. Additionally, it includes commands for viewing commit history and managing files within a Git project.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

1) git config --global user.

name "Ahmed Mohammed"


configuration the user name globally in all projects with the same user name

2)git config --global user.Email "[email protected]"


configuration the user email globally in all projects with the same user email

3)create repo in coding folder to make versionControl ---> git init

4)git status --> to show the status of the project to know if there is a new
updates on the projects must be committed or not
--> git add to save changes --> git add filename or git add ./-A/--all (add all
changes)

5) git rm --cached (remove tracked file that's watiting to commit)

6).git ignore file to ignore specific files

- ignore all files that include extenstion .txt --> /*ignore all files end
with .txt */-->(*.txt)

7) after add changes --> git commit -m "message" commit all files with this message

8) git diff to show changes is not commited

9) git commit -a -m "add and commit in one step (msg)"

10) git rm filename(remove file) ,,, git restore "" to undo

11) git mv "old_filename" "new_fileName" changing filename

12) clear to clean screen


13) git log to see all commits
14) git log --oneline see all commits in abstract way

15) git commit -m "msg" --amend -->change the msg of the last commit

16) git log -P --> all commits with details

17) git branch to show all branches

18) git branch "branch_name "-->make new branch

19) git checkout or switch "branch_name" to work in specific branch

20) to merge we need to stand on master then --> git merge -m "msg" branch_name

21) git branch -d branch_name --> delete branch

22) git switch -c "new_branch_name" create and switch to branch in one step

23) push local to remote(gitHub)


-- git remote add origin remote_link
-- git branch -m master or main ‫علي حسب انت عامل اي ف المحلي‬
-- git push -u origin master or main(authentication required)

24) to push all branches --> git push --all


25) git pull origin branch_name--> to make the updates in local that's made in
remote

26) git clone HHTPS_LINK

27) to upload to remote --> git push

You might also like