1 - Git Command
1 - Git Command
1 - Git Command
*pwd
*mkdir The_Name
-->Removes a folder
*cd The_Name/
Inside a folder we can be making our repositories. A repo is a folder. Initialized by:
*git init
*touch filename.extension
*localProgramName filename
-->it shows which branch we’re at, the commits we’ve had so far, untracked files or added files to
commit, etc.
.
*git add or filename.ext
*git log
-->shows your commits ids, in which branch, the author (name and email), what date too, etc
You create a new repo (with the same local repo name) in the Git server account and then, connect it to
your local repo:
*git remote -v
…………………………………………………………………………………………………………………………………………………………………
-->to link to a git server with ssh. To clone git server repos to local repos.
After pasting the public ssh to git server
*ssh –T git@github.com
After creating a repo in git server, go to clone repo and paste the ssh link. Navigate to the local root
folder for repos and:
*ls -ltr
-->removes/undoes all changes made in higher commits than commit3, but the changes still remaining
there – possible to revert. More for local repos
-->removes/undoes all changes made in this commit. More for git server repos.
*git branch -v
-->to merge a branch (its files, changes, etc.) to the current branch we’re in now
-->to delete a branch locally, being out of it (in the main branch)