Share

Search Unix Commands/Scripts


  Help us in improving the repository. Add new commands/scripts through 'Submit Commands/Scripts ' link.





Unix Commands/Scripts for '#Git' - 17 Commands/Scripts found

 Sample 1. Clone a repository / checkout project in Git

git clone <repository_url>

   Like      Feedback     


 Sample 2. Push your project to Git

cd <PROJECT_ROOT_DIRECTORY>
git init
git add --all
git commit -m "<COMMIT_COMMENT>"
git remote add origin <GIT_REPO_CLONE_URL>
git push -u origin <BRANCH>

example

cd /home
git init
git add --all
git commit -m "First Commit"
git remote add origin https://xys/abc.git
git push -u origin master

   Like      Feedback     Git


 Sample 3. Moving a file to staging

git add

   Like      Feedback     git


 Sample 4. Moving file from staging to head

git commit <file_name>

   Like      Feedback     git


Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner
 Sample 5. Moving file from Head on local to remote ?

git push <file_name>

   Like      Feedback     git


 Sample 6. /difference between git add , git commit and git push ?


   Like      Feedback     git


 Sample 7. Does git commit , commits the file to remote ?


   Like      Feedback     git


 Sample 8. Setting the remote project for the Git initialized local project

git remote add origin <git_repo_url>

   Like      Feedback     git


 Sample 9. Merging remote changes to local

git pull

   Like      Feedback     git


Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner
 Sample 10. Create a Git branch

Git branch <Branch_name>

   Like      Feedback     git


 Sample 11. Switch to a new branch in git

git checkout <branch_name>

   Like      Feedback     git


 Sample 12. Create and checkout the new branch in git

git checkout -b <branch_name>

   Like      Feedback     git


 Sample 13. Add all files to the index for commit and push in git

git add .

   Like      Feedback     


 Sample 14. Git commit

git commit -m "Commit Message"

   Like      Feedback     


Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner
 Sample 15. Steps in Git push from local to remote

git add .
git commit -m "message"
git push

   Like      Feedback     


 Sample 16. Commands and Steps for resolving Merge conflict in Git

git fetch ( it will only bring the remote code to local but won't attempt to merge )
git status ( will show the merge conflicts )
Fix the Merge conflicts
git add .
git commit
git push

   Like      Feedback     


 Sample 17. Change commit message in Git

git commit --amend

   Like      Feedback     git



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus