0% found this document useful (0 votes)
3 views1 page

Github Notes

The document outlines basic Git and GitHub commands, including repository management, status types, and branching. It explains commands for adding, committing, pushing changes, and merging branches. Additionally, it covers terminal commands for navigating directories and managing files.

Uploaded by

Angad Mago
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Github Notes

The document outlines basic Git and GitHub commands, including repository management, status types, and branching. It explains commands for adding, committing, pushing changes, and merging branches. Additionally, it covers terminal commands for navigating directories and managing files.

Uploaded by

Angad Mago
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

repository --> folder

commit --> change


first change is added then committed
GitHub helps us skip this add wala part
README is not like normal text files uske ke liye alag syntax use karna padta hai
ya html bhi use kar sakte hai
remote --> GitHub
local --> our device
clone command --> git clone (link) --> for cloning a repo in our local machine
status command --> git status --> to display the status of the code (modified or
not) (to do this use cd command to change the directory)
after modifying we need to add and commit

TYPES OF STATUS
1) Untracked (git doesn't know about this whole file)
2) Modified
3) Staged (file is ready to be committed)
4) Unmodified (no change)

add command --> git add (file name) --> to bring the file to add stage
*use command [git add .] to add all files
commit command --> git commit-m "message"
push command --> git push origin main --> to push git to GitHub from local machine
to make the repo made on local device to git --> git init
to upload that git into GitHub --> git remote add origin (link of the local repo
made in GitHub)
to check branch --> git branch
to change name of the branch --> git branch -M (new name)
now to push all the codes into the GitHub repo --> git push origin main [git push -
u origin main (the u prevents us from writing origin main again and again and makes
it our default upload region)]

BRANCHES

git branch --> to check the current branch we're at


git branch -M (name of branch) --> to change name of branch
git checkout (branch name) --> to navigate to a different branch
git checkout -b (new branch name) --> to create a branch
git branch -d (branch name) --> to delete a branch
command discovered by me git checkout -d (branch name) --> creates a detached head
git push origin (branch name) --> to push the changes in the branch and display the
changes/branch in GitHub

MERGING

1) via GitHub creating PR and accepting PRs


2) via vscode

BASIC TERMINAL COMMAND


cd --> change directory (to go from bahar wala folder to andar wala folder)
ls --> list files (to list all the files in the current directory/folder and gives
all the details on the file)
ls -a --> error (check) ALTERNATIVE [git remote -v]
cd .. --> to exit the current directory (andwar wale folder se bahar aana)
mkdir (name) --> to make a new directory

You might also like