-
git config --global user.name "xyz" git config --global user.email "[email protected]" -> To create a git account and use this on github to login. Use global to set the username for every repository you create git --version to check the git version installed
-
mkdir -> create a new directory
-
cd -> to change the current working directory
-
git init -> to create a empty git repository in the specified folder How to check if it is a git repository? So it has created a hidden file .git inside your folder which can be seen by command ls -la
-
git status -> to check the status of the file if it is part of our repo or not git status --short -> To see status in a shorter format i) Tracked files ii) Untracked files iii) Modified files
-
git add . or filename or --all -> To add the untracked file to the repo but yet are to commited to the repo(Just added)
-
git commit -m "Placeholder" -m "Description"-> To commit the changes made to the repo and reflect it in local machine not at github git commit -am "Placeholder" -m "Description"-> To commit and add the changes made to the file at once to a modified file
-
git clone sshlink -> this will clone the repository into your folder
-
git log -> to view the commits history for the repository
-
git help --all -> to get help for the command If you find yourself stuck in the list view, SHIFT + G to jump the end of the list, then q to exit the view.
-
SSH Keys ->SSH Keys are unique keys with which you can connect to github without any user name or personal access token at each visit.
-
git push -u origin master -> To finally push the files to the github repo
-
git remote add origin (link of repo from github)
-
git remote -v -> To check if it is linked to any repo or not
-
Fork to get another person repo into your repo
-
git branch -> to get list of all the branches
-
git checkout -b newbranch -> to create a new branch and switch between branches
-
git diff branchname-> to check difference between both the branches
-
git branch -d branchname -> to delete the branch
-
git pull in main branch -> to get all the pr which were merged into your local machine Pull is series of two steps fetching and merging
-
Notifications
You must be signed in to change notification settings - Fork 0
Bhavya418/Git-Github-Commands
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published