lalitrane
12/11/2019 - 2:07 AM

github-tutorial

git init git status git add git add . #Add all files git commit -m "This is my first commit!" git push -u origin master git push -f origin master #If first push didn't work

!h Push an existing folder cd existing_folder git init git remote add origin git@gitlab.com:Instaffo/Pages/instaffolp2019/website2019.git git add . git commit -m "Initial commit" git push -u origin master

!h Discard the local changes git reset --hard

!h Branching git branch - a #Display all the branch list git branch feature1 #create new branch names feature1 git checkout feature1 #switch feature1 to the active branch */ git checkout -b feature2 #shortcut to create a new branch and make it active */ git branch -d feature1 #delete branch with confirmation warning message git branch -D feature1 #delete branch without ant confirmation git merge feature1

!h Create a new repository git clone https://github.com/lalitrane/html-boilerplate.git cd website2019 touch README.md git add README.md git commit -m "add README" git push -u origin master

!h Create a bare clone of the repository. git clone --bare https://github.com/lalitrane/html-boilerplate.git cd old-repository.git #Mirror-push to the new repository. git push --mirror https://github.com/exampleuser/new-repository.git #Mirror-push to the new repository. cd .. $ rm -rf old-repository.git #Remove the temporary local repository you created in step 1.

!h Git(lab) global setup git config --global user.name "Lalit Rane" git config --global user.email "lalitrane@outlook.com"