GIT & GITHUB
basically
- GIT.
version control
- GITHUB.
collab
terminology
- Repo
A project
- Commit
Save Staged Changes. Basically save/update/delete files in the spotlight(stage).
- hash
- allows history browsing with notes
- Branching
main branch(default master)= root
- other branches = experimentals
- merge branches to include.
- Push
upload commits to remote.
- Pull Request
request to merge branches/ forks.
- Fork
create a duplicate , no change to core repo.
- Issues
to resolve, suggestions or bugs,ideas, sticky notes of todos
- if u commit with a fixes #issueId, issue closed automaticalyy with that commit
- Clone
Download/Pull from server
- Remote
clone living on some server, here, GITHUB.
- Make a branch named gh-pages, and switch on the github pages for it. This hosts ur site on github.io :).
copy pasta commands
- make present working directory a git repo
git init
- stage file to commit
git add filename
- stage all changes
git add .
- stage all files currently existing in location.
git add *
- delete a file and stage it’s deletion.
git rm fname
- commit the staged files with commit message.
git commit -m msg
- commit all changes in curr repo with msg
git commit -a -m "msg"
- reset last n commits
git reset --soft HEAD~n
- rename main branch
git branch -M localMain
- track changes of a remote branch
git branch --set-upstream-to=localNameForRemoteRep/branchname localbranchename
- list remotes assosiated, and describe them
git remote -v
- add a link to a repo on some remote server
git remote add localNameForRemoteRep remoteRepoUrl
- get changes made in given branch of remote repo and update local branch with them.
git pull localNameForRemoteRep branchename
- upload current repository data and status to clone on server
git push localNameForRemoteRep branchename
- switch to another branch
git checkout branchname
- switch to new branch
git checkout -b branchname
- check changes, branch , etc.
git status
- show history upto last n commits/branches in Vim, exit by >q
git log -n
- configure
git config --global user.name "name" git config --global user.email "mail"