Openunix.eu


Git

Here follows a simple git command overview:

start your own local NEW repository

$ git init 

Two examples of cloning, one simple, the other with port option

ยง git clone https://github.com/WayneD/rsync.git -- clones a remote repo over https to your folder
$ git clone [git@gitea.virginia.com:6080]:jimmy/project.git -- clones a repo over ssh on port 6080

makes your system up to date with upstream origin

$ git pull 

add folder content, commit it and upload to server

$ git add .   
$ git commit -m "minor changes"
$ git push 

shows the remote server url

$ git remote -v 

List all branches and switch to devel

git branch --list
$ git checkout devel

Create new branch and switch to it and make it appear on the server.

$ git branch my-new-branch
$ git checkout my-new-branch 

Rename a branch

$ git -m my-new-branch my-super-branch

Push freshly created new branch to the server

$ git push --set-upstream origin my-super-branch
 

Powered by NetBSD. Running on a toaster.