GitBash Flashcards
Initialize
$ git init
Add Name & Email
$ git config –global user.name “YourName”
user.email “your.email@provider.com”
Add File
$ git add fileName.fileExtension
. for any fileName & fileExtension
. for all
Unstage File
$ git rm –cached
Commit
Commit (Skip Vim Editor)
$ git commit
$ git commit -m ‘Changed app.js’
Create Ignore File to ignore
and
touch .gitignore
.gitingore
|->fileName.fileExtension
|->\folderName
Brach put from ‘master’
So that you do not effect the main code
$ git branch branchName
Go to yourBranch
$ git checkout nameOfYourBranch
To view remote repository
To add remote repository
$ git remote
$ git remote [link from github]
Upload to repository
$ git push -u repoName master
Clone a repository
$ git clone [link]
Download changed repo
$ git pull
View git Status
i.e
View Staged Files
View Untracked Files
$ git status