Skip to content

Instantly share code, notes, and snippets.

@cristicristi7
Last active June 12, 2022 14:05
Show Gist options
  • Save cristicristi7/4eda673441ab8d263551333ff44b62f2 to your computer and use it in GitHub Desktop.
Save cristicristi7/4eda673441ab8d263551333ff44b62f2 to your computer and use it in GitHub Desktop.
Notes
1) Initializating a project: git init
2) Seeing your status: git status
3) Adding to the stage: git add (nameofthefile or . (which is all))
4) Adding to the head (local repository) "make a commit": git commit -m "nameofthechange"
5) Addding content to the repository: git push (nameofthefile or . (which is all))
6) git remote add origin https://github.com/cristicristi7/Powerpuff-Girls
7) git push -u origin master
REMOVE ORIGIN GIT
$ git remote -v. # View current remotes.
> destination https://github.com/FORKER/REPOSITORY.git (push) ​
$ git remote rm destination. # Remove remote.
$ git remote -v. # Verify it's gone.
6) Downloading content from the repository (remote repository): git pull
7) Creating and moving to a new branch: git checkout -b nameofthebranch
8) Deleting a branch: git branch -d nameofthebranch
9) Merging branchs: git merge nameofthebranch
10) Seeing the difference: git diff
11) Clonating a branch: git clone -b nameofthebranch urlRepository
12) Update changes to the local repository (head): git fetch
13) Cloning a repository: git clone url
14) Sending content to the master branch: pull request
*If you are in a branch, pull request will do a merge of your branch and then you can send your changes.
*If you are in local: git request-pull ...
15) git fetch --prune (eliminating remote branch which are already deleted from GitHub)
16) git branch -D branchname (elimitating local branch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment