Git & GitHub
Git & GitHub
-------------
1. to display all the branches and your current branch ?
git branch
press enter
2.to create new branch ?
git branch <branch name>
git branch dev
git branch new
dev branch will be created automatically
git branch ---display purpose
3.to modify branch name
git branch -m <your branch name>
git branch -m feature
git branch ---display purpose
4.to switch from one branch to another branch
git checkout <branch name>
git checkout dev
git branch ---display purpose
display all the available branches in your repository
and also your current branch
* (star) symbol is always pointing to current branch
to push the code
how to setup alias name for your GitHub Remote Repository
=========================================================
shortcut name for your GitHub repo
because this very lengthy
I want to add alias name for my GitHub remote repository
my alias name = origin
just we push the code into GitHub remote repo very easily
instead of using my lengthy GitHub repository name ,
always I use alias name that is "origin"
whenever I want to push the code-- I use only "origin"
command --->remote --for your remote repository
option --->add --add the alias name for your remote repository
1. git remote add origin https://github.com/kk1567811/RidesApp
press enter button
2.after that you can push the code into GitHub repo
git push -u origin master
press enter button
here ---> origin = https://github.com/kk1567811/RidesApp
3.enter your user name & password
user name :kk1567811
password (access token) --personal access token
my GitHub admin /DevOps Team provide user name & password(access token)
ex: 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
successfully you push code from local to remote repository
4.go to remote repo and check the code
-------------
1. to display all the branches and your current branch ?
git branch
press enter
2.to create new branch ?
git branch <branch name>
git branch dev
git branch new
dev branch will be created automatically
git branch ---display purpose
3.to modify branch name
git branch -m <your branch name>
git branch -m feature
git branch ---display purpose
4.to switch from one branch to another branch
git checkout <branch name>
git checkout dev
git branch ---display purpose
display all the available branches in your repository
and also your current branch
* (star) symbol is always pointing to current branch
to push the code
how to setup alias name for your GitHub Remote Repository
=========================================================
shortcut name for your GitHub repo
because this very lengthy
I want to add alias name for my GitHub remote repository
my alias name = origin
just we push the code into GitHub remote repo very easily
instead of using my lengthy GitHub repository name ,
always I use alias name that is "origin"
whenever I want to push the code-- I use only "origin"
command --->remote --for your remote repository
option --->add --add the alias name for your remote repository
1. git remote add origin https://github.com/kk1567811/RidesApp
press enter button
2.after that you can push the code into GitHub repo
git push -u origin master
press enter button
here ---> origin = https://github.com/kk1567811/RidesApp
3.enter your user name & password
user name :kk1567811
password (access token) --personal access token
my GitHub admin /DevOps Team provide user name & password(access token)
ex: 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
successfully you push code from local to remote repository
4.go to remote repo and check the code
Comments
Post a Comment