Skip to content

Instantly share code, notes, and snippets.

@samyarmodabber
Last active December 4, 2022 16:04
Show Gist options
  • Save samyarmodabber/ee1ee5804649f0ffe73f200940c94bfd to your computer and use it in GitHub Desktop.
Save samyarmodabber/ee1ee5804649f0ffe73f200940c94bfd to your computer and use it in GitHub Desktop.
Start with git

Git Basic Commands

1_odxtilqfN40uE5hfGAJWPQ

Remove a remote

1) First check the name of your remotes

$ git remote -v

2) Remove by the name

$ git remote rm <REMOTE_NAME>

3) Example

$ git remote -v

> origin  https://github.com/OWNER/REPOSITORY.git (fetch)
> origin  https://github.com/OWNER/REPOSITORY.git (push)
> destination  https://github.com/FORKER/REPOSITORY.git (fetch)
> destination  https://github.com/FORKER/REPOSITORY.git (push)

$ git remote rm destination

$ git remote -v
> origin  https://github.com/OWNER/REPOSITORY.git (fetch)
> origin  https://github.com/OWNER/REPOSITORY.git (push)

Merge a branch with master

Let we have a brach with name "develop"

1) Go to develop branch and Commit the changes:

$ git checkout develop
$ git add –A
$ git commit –m "Some changes on navbar"

2) Go to master branch and merge

$ git checkout master
$ git merge develop

Github Starter

create a new repository on the command line

echo "# modabbersam" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/OWNER/REPOSITORY.git
git push -u origin master

OR push an existing repository from the command line

git remote add origin https://github.com/OWNER/REPOSITORY.git
git push -u origin master
@samyarmodabber
Copy link
Author

samyarmodabber commented Oct 18, 2019

Please leave me a comment if it is useful. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment